Struct mgf::StaticBody
[−]
[src]
pub struct StaticBody<'a, S: Shape + 'a> { pub friction: f32, pub shape: &'a S, }
A physical object that cannot move. Can be constructed from any shape. Only 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, T> Collider<Intersection, T> for StaticBody<'a, S> where
S: Shape + Collider<Intersection, T>, [src]
S: Shape + Collider<Intersection, T>,
fn collide<F: FnMut(Intersection)>(&self, rhs: &T, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl<'a, S, T> Collider<Contact, T> for StaticBody<'a, S> where
S: Shape + Collider<Contact, T>, [src]
S: Shape + Collider<Contact, T>,
fn collide<F: FnMut(Contact)>(&self, rhs: &T, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any 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