Trait mgf::PhysicsObject
[−]
[src]
pub trait PhysicsObject { fn integrate(&mut self, dt: f32); fn get_dx(&self) -> Velocity; fn set_dx(&mut self, v: Velocity); fn pos(&self) -> Point3<f32>; fn inv_mass(&self) -> f32; fn inv_moment(&self) -> Matrix3<f32>; fn restitution(&self) -> f32; fn friction(&self) -> f32; }
A type that exhibits physical properties.
Required Methods
fn integrate(&mut self, dt: f32)
Integrate the object over the time step.
fn get_dx(&self) -> Velocity
Return the velocity of the object.
fn set_dx(&mut self, v: Velocity)
Set the velocity of the object.
fn pos(&self) -> Point3<f32>
Return the position of the object at the end of the time step.
fn inv_mass(&self) -> f32
Return the inverse mass of the object.
fn inv_moment(&self) -> Matrix3<f32>
Return the inverse moment of inertia tensor for the object.
fn restitution(&self) -> f32
Return the coefficient of restitution for the object.
fn friction(&self) -> f32
Return the friction coefficient for the object.
Implementors
impl PhysicsObject for CompoundDynamicBody
impl<S> PhysicsObject for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,impl<'a, S: Shape + 'a> PhysicsObject for StaticBody<'a, S>