ReadRigidBodyForces

Trait ReadRigidBodyForces 

Source
pub trait ReadRigidBodyForces: ReadRigidBodyForcesInternal {
    // Provided methods
    fn position(&self) -> &Position { ... }
    fn rotation(&self) -> &Rotation { ... }
    fn linear_velocity(&self) -> Vector { ... }
    fn angular_velocity(&self) -> Vector { ... }
    fn accumulated_linear_acceleration(&self) -> Vector { ... }
    fn accumulated_angular_acceleration(&self) -> Vector { ... }
    fn velocity_at_point(&self, world_point: Vector) -> Vector { ... }
}
Expand description

A trait for reading forces of a dynamic rigid body.

This is implemented as a shared interface for the ForcesItem and NonWakingForcesItem returned by Forces.

See the documentation of Forces for more information on how to work with forces in Avian.

Provided Methods§

Source

fn position(&self) -> &Position

Returns the Position of the body.

Source

fn rotation(&self) -> &Rotation

Returns the Rotation of the body.

Source

fn linear_velocity(&self) -> Vector

Returns the LinearVelocity of the body in world space.

Source

fn angular_velocity(&self) -> Vector

Returns the AngularVelocity of the body in world space.

Source

fn accumulated_linear_acceleration(&self) -> Vector

Returns the linear acceleration that the body has accumulated before the physics step in world space, including acceleration caused by forces.

This does not include gravity, contact forces, or joint forces. Only forces and accelerations applied through Forces are included.

Source

fn accumulated_angular_acceleration(&self) -> Vector

Returns the angular acceleration that the body has accumulated before the physics step in world space, including acceleration caused by torques.

This does not include gravity, contact forces, or joint forces. Only torques and accelerations applied through Forces are included.

Source

fn velocity_at_point(&self, world_point: Vector) -> Vector

Returns the velocity of a point in world space on the body.

Implementors§