Struct nphysics2d::object::RigidBody [] [src]

pub struct RigidBody<N: Real> { /* fields omitted */ }

The rigid body structure.

This is the structure describing an object on the physics world.

Methods

impl<N: Real> RigidBody<N>
[src]

[src]

Gets a reference to this body's transform.

[src]

The center given by this object's position. May not be the same as its center of mass.

This is the point with coordinates self.position().translation.vector.

[src]

A reference to this body's shape handle.

[src]

The margin surrounding this object's shape.

[src]

Sets the margin surrounding this object's shape.

[src]

Gets a reference to this body's center of mass.

[src]

Gets this body's mass, if it has one.

[src]

Gets this body's restitution coefficent.

The actual restitution coefficient of a contact is computed averaging the two bodies restitution coefficient.

[src]

Gets this body's friction coefficient.

The actual friction coefficient of a contact is computed averaging the two bodies friction coefficient.

[src]

Indicates whether or not this rigid body is active.

An inactive rigid body is a body that did not move for some time. It is not longer simulated by the physics engine as long as no other object touches it. It is automatically activated by the physics engine.

[src]

The velocity threshold bellow whith the rigid body might be deactivated.

If None, the object cannot be deactivated. If the total squared velocity (i-e: v2 + w2) falls bellow this threshold for a long enough time, the rigid body will fall asleep (i-e be "frozen") for performance reasons.

[src]

Set the velocity threshold bellow whith the rigid body might be deactivated.

If None, the object cannot be deactivated. If the total squared velocity (i-e: v2 + w2) falls bellow this threshold for a long enough time, the rigid body will fall asleep (i-e be "frozen") for performance reasons.

[src]

Creates a new rigid body that can move.

[src]

Creates a new rigid body that cannot move.

[src]

Creates a new rigid body with a given shape.

Use this if the shape is shared by multiple rigid bodies. Set mass_properties to None if the rigid body is to be static.

[src]

Indicates whether this rigid body is static or dynamic.

[src]

Gets the linear acceleraction scale of this rigid body.

[src]

Sets the linear acceleration scale of this rigid body.

[src]

Gets the angular acceleration scale of this rigid body.

[src]

Sets the angular acceleration scale of this rigid body.

[src]

Get the linear velocity of this rigid body.

[src]

Sets the linear velocity of this rigid body.

[src]

Gets the linear acceleration of this rigid body.

[src]

Gets the angular velocity of this rigid body.

[src]

Sets the angular velocity of this rigid body.

[src]

Gets the angular acceleration of this rigid body.

[src]

Resets linear and angular force.

[src]

Resets linear force.

[src]

Resets angular force.

[src]

Adds an additional linear force.

[src]

Adds an additional angular force.

[src]

Adds an additional force acting at a point different to the center of mass.

The pnt_to_com vector has to point from the center of mass to the point where the force acts.

[src]

Forces the body to respond to any impulses before the next tick.

[src]

Applies a one-time central impulse.

[src]

Applies a one-time angular impulse.

[src]

Applies a one-time impulse to a point relative to the center of mass.

The pnt_to_com vector has to point from the center of mass to the point where the impulse acts.

[src]

Gets the inverse mass of this rigid body.

[src]

Sets the inverse mass of this rigid body.

[src]

Gets the inverse inertia tensor of this rigid body.

[src]

Sets the inverse inertia tensor of this rigid body.

Not that this is reset at every update by the physics engine.

[src]

Appends a transformation to this rigid body.

[src]

Prepends a transformation to this rigid body.

[src]

Sets the transformation of this rigid body.

[src]

Appends a translation to this rigid body.

[src]

Prepends a translation to this rigid body.

[src]

Stes the translation of this rigid body.

[src]

Appends a rotation to this rigid body.

[src]

Prepends a rotation to this rigid body.

[src]

Sets the rotation of this rigid body.

[src]

Reference to the collision groups of this rigid body.

[src]

Set the new collisions groups of this rigid body.

[src]

Reference to user-defined data attached to this rigid body.

[src]

Mutable reference to user-defined data attached to this rigid body.

[src]

Attach some user-defined data to this rigid body and return the old one.

Trait Implementations

impl<N: Real> Clone for RigidBody<N>
[src]

[src]

Clones this rigid body but not its associated user-data.

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N, M> HasBoundingVolume<M, BoundingSphere<Point<N>>> for RigidBody<N> where
    N: Real,
    M: Copy + Mul<Isometry<N>, Output = Isometry<N>>, 
[src]

[src]

The bounding volume of self transformed by m.

impl<N, M> HasBoundingVolume<M, AABB<Point<N>>> for RigidBody<N> where
    N: Real,
    M: Copy + Mul<Isometry<N>, Output = Isometry<N>>, 
[src]

[src]

The bounding volume of self transformed by m.