Struct mgf::PhysicsState [] [src]

pub struct PhysicsState {
    pub restitution: f32,
    pub friction: f32,
    pub inv_mass: f32,
    pub inv_moment: Matrix3<f32>,
    pub x: Point3<f32>,
    pub v: Vector3<f32>,
    pub omega: Vector3<f32>,
}

A description of the physical state of an object.

Fields

Restitution is a measure of how much kinetic energy is retained in a collision. 100% of kinetic energy retention corresponds to a coefficient of one.

We simplify friction in this case to simply be a ratio of the normal force applied tangentially to an object during collision.

We only ever need inverse mass for calcuations, plus it gives a neat advantage that we can represent immovable objects with an infinite mass, or an inverse mass of zero.

The inverse moment of inertia tensor of the object correctly oriented.

The position of the object at the end of the timestep.

The linear velocity of the object

The angular velocity of the object

Methods

impl PhysicsState
[src]

[src]

Perform collision resolution on two physics states from a contact and a timestep.

[src]

Perform collision resolution from a manifold. This is the preferred method for resolving two bodies.

Trait Implementations

impl Copy for PhysicsState
[src]

impl Clone for PhysicsState
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more