Trait mgf::PhysicsObject
[−]
[src]
pub trait PhysicsObject { fn integrate(&mut self, dt: f32); fn state(&self) -> PhysicsState; fn apply_impulse(&mut self, linear: Vector3<f32>, angular: Vector3<f32>); fn update_dx(&mut self); }
A type that exhibits physical properties.
A PhysicsObject's primary function is to return a PhysicsState to be used
during collision resolution. Beyond that it has various methods to be updated
or choose to ignore such updates (for example, calling apply_impulse
on a
StaticBody is a no-op).
Required Methods
fn integrate(&mut self, dt: f32)
Integrate the object over the timestep
fn state(&self) -> PhysicsState
Return the physics state of the object
fn apply_impulse(&mut self, linear: Vector3<f32>, angular: Vector3<f32>)
Apply linear and angular impulse to the object
fn update_dx(&mut self)
Update the linear and angular positional derivatives
Implementors
impl PhysicsObject for RigidBody
impl<'a, S: Shape + 'a> PhysicsObject for StaticBody<'a, S>