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> Intersects<RHS> for StaticBody<'a, S> where
S: Intersects<RHS> + Shape,
[src]
S: Intersects<RHS> + Shape,
fn intersection(&self, rhs: &RHS) -> Option<Intersection>
[src]
Returns an Intersection if one exists.
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 timestep
fn state(&self) -> PhysicsState
[src]
Return the physics state of the object
fn apply_impulse(&mut self, _linear: Vector3<f32>, _angular: Vector3<f32>)
[src]
Apply linear and angular impulse to the object
fn update_dx(&mut self)
[src]
Update the linear and angular positional derivatives