[][src]Struct physme::dim3::RigidBody

pub struct RigidBody {
    pub position: Vec3,
    pub rotation: Quat,
    pub linvel: Vec3,
    pub terminal: Vec3,
    pub angvel: Quat,
    pub ang_term: f32,
    pub status: Status,
    // some fields omitted
}

The rigid body.

Fields

position: Vec3

Current position of this rigid body.

rotation: Quat

Current rotation of this rigid body.

NOTE: collisions checks may or may not be broken if this is not a multiple of 90 degrees.

linvel: Vec3

Current linear velocity of this rigid body.

terminal: Vec3

The terminal linear velocity of a semikinematic body.

Defaults to f32::INFINITY.

angvel: Quat

Current angular velocity of this rigid body.

ang_term: f32

The terminal angular velocity of a semikinematic body.

Defaults to f32::INFINITY.

status: Status

The status, i.e. static or semikinematic.

Affects how forces and collisions affect this rigid body.

Implementations

impl RigidBody[src]

pub fn new(mass: Mass) -> Self[src]

Returns a new RigidBody with just a mass and all other components set to their defaults.

pub fn with_position(self, position: Vec3) -> Self[src]

Returns a RigidBody identical to this one, but with the position set to a new one.

pub fn with_rotation(self, rotation: Quat) -> Self[src]

Returns a RigidBody identical to this one, but with the rotation set to a new one.

pub fn with_linear_velocity(self, linvel: Vec3) -> Self[src]

Returns a RigidBody identical to this one, but with the linear velocity set to a new one.

pub fn with_angular_velocity(self, angvel: Quat) -> Self[src]

Returns a RigidBody identical to this one, but with the linear velocity set to a new one.

pub fn with_terminal(self, terminal: Vec3) -> Self[src]

Returns a RigidBody identical to this one, but with the terminal linear velocity set to a new one.

pub fn with_angular_terminal(self, terminal: f32) -> Self[src]

Returns a RigidBody identical to this one, but with the terminal linear velocity set to a new one.

pub fn with_acceleration(self, acceleration: Vec3) -> Self[src]

Returns a RigidBody identical to this one, but with the acceleration set to a new one.

pub fn with_status(self, status: Status) -> Self[src]

Returns a RigidBody identical to this one, but with the status set to a new one.

pub fn with_active(self, active: bool) -> Self[src]

Returns a RigidBody identical to this one, but with the active flag set to a new one.

pub fn with_sensor(self, sensor: bool) -> Self[src]

Returns a RigidBody identical to this one, but with the sensor flag set to a new one.

pub fn apply_linear_impulse(&mut self, impulse: Vec3)[src]

Applies an impulse to the RigidBodys linear velocity.

pub fn apply_angular_impulse(&mut self, impulse: Quat)[src]

Applies an impulse to the RigidBodys linear velocity.

pub fn apply_force(&mut self, force: Vec3)[src]

Applies a force to the RigidBodys acceleration accumulator.

pub fn is_active(&self) -> bool[src]

Gets the active flag.

pub fn is_sensor(&self) -> bool[src]

Gets the sensor flag.

pub fn mass(&self) -> f32[src]

Gets the mass

pub fn inverse_mass(&self) -> f32[src]

Gets the mass

pub fn set_active(&mut self, active: bool)[src]

Sets the active flag.

pub fn set_sensor(&mut self, sensor: bool)[src]

Sets the sensor flag.

pub fn set_mass(&mut self, mass: Mass)[src]

Sets the mass.

Trait Implementations

impl Clone for RigidBody[src]

impl Copy for RigidBody[src]

impl Debug for RigidBody[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,