use beet_core::prelude::*;
#[derive(
Debug, Default, Clone, PartialEq, Deref, DerefMut, Component, Reflect,
)]
#[reflect(Component, Default)]
pub struct Velocity(pub Vec3);
impl Velocity {
pub fn from_xyz(x: f32, y: f32, z: f32) -> Self { Self(Vec3::new(x, y, z)) }
}
#[derive(Debug, Clone, PartialEq, Deref, DerefMut, Component, Reflect)]
#[reflect(Component, Default)]
#[require(Velocity)]
pub struct VelocityScalar(pub Vec3);
impl Default for VelocityScalar {
fn default() -> Self { Self(Vec3::ONE) }
}
#[derive(
Debug, Default, Clone, PartialEq, Deref, DerefMut, Component, Reflect,
)]
#[reflect(Component, Default)]
#[require(Velocity)]
pub struct Impulse(pub Vec3);
#[derive(
Debug, Default, Clone, PartialEq, Deref, DerefMut, Component, Reflect,
)]
#[reflect(Component, Default)]
#[require(Velocity)]
pub struct Force(pub Vec3);
#[derive(
Debug, Copy, Clone, PartialEq, Deref, DerefMut, Component, Reflect,
)]
#[reflect(Component, Default)]
#[require(Velocity)]
pub struct Mass(pub f32);
impl Default for Mass {
fn default() -> Self { Self(1.0) }
}
#[allow(missing_docs)]
#[derive(Default, Bundle)]
pub struct ForceBundle {
pub mass: Mass,
pub velocity: Velocity,
pub impulse: Impulse,
pub force: Force,
}