Skip to main content

PhysicsBody

Trait PhysicsBody 

Source
pub trait PhysicsBody {
    // Required methods
    fn transform(&self) -> &Transform;
    fn transform_mut(&mut self) -> &mut Transform;
    fn mass(&self) -> Real;

    // Provided methods
    fn inv_mass(&self) -> Real { ... }
    fn is_dynamic(&self) -> bool { ... }
    fn is_static(&self) -> bool { ... }
}
Expand description

Trait for objects that represent a physics body.

Required Methods§

Source

fn transform(&self) -> &Transform

Return the current transform of this body.

Source

fn transform_mut(&mut self) -> &mut Transform

Return a mutable reference to the transform.

Source

fn mass(&self) -> Real

Return the mass of this body (kg). Returns 0 for static/kinematic.

Provided Methods§

Source

fn inv_mass(&self) -> Real

Return the inverse mass. Returns 0 for static/kinematic.

Source

fn is_dynamic(&self) -> bool

Whether this body participates in dynamics integration.

Source

fn is_static(&self) -> bool

Whether this body is treated as immovable.

Implementors§