Struct mgf::StaticBody
[−]
[src]
pub struct StaticBody<'a, S: Shape + 'a> { pub friction: f32, pub shape: &'a S, }
A physical object that cannot move.
A static body is an immovable object that can be constructed from any shape, the only other parameter required is a value for friction.
A StaticBody is not a Shape and cannot be moved. StaticBodies contain a reference to the Shape they mimic and thus should not live very long.
Fields
friction: f32
shape: &'a S
Methods
impl<'a, S: Shape + 'a> StaticBody<'a, S>
[src]
Trait Implementations
impl<'a, S, B> BoundedBy<B> for StaticBody<'a, S> where
B: Bound,
S: Shape + BoundedBy<B>,
[src]
B: Bound,
S: Shape + BoundedBy<B>,
impl<'a, S, RHS> Contacts<RHS> for StaticBody<'a, S> where
S: Contacts<RHS> + Shape,
[src]
S: Contacts<RHS> + Shape,
fn contacts<F: FnMut(Contact)>(&self, rhs: &RHS, callback: F) -> bool
[src]
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl<'a, S: Shape + 'a> PhysicsObject for StaticBody<'a, S>
[src]
fn integrate(&mut self, _dt: f32)
[src]
Integrate the object over the time step.
fn get_dx(&self) -> Velocity
[src]
Return the velocity of the object.
fn set_dx(&mut self, _v: Velocity)
[src]
Set the velocity of the object.
fn pos(&self) -> Point3<f32>
[src]
Return the position of the object at the end of the time step.
fn inv_mass(&self) -> f32
[src]
Return the inverse mass of the object.
fn inv_moment(&self) -> Matrix3<f32>
[src]
Return the inverse moment of inertia tensor for the object.
fn restitution(&self) -> f32
[src]
Return the coefficient of restitution for the object.
fn friction(&self) -> f32
[src]
Return the friction coefficient for the object.