Struct lnkit::prelude::RigidBodyBuilder[][src]

pub struct RigidBodyBuilder { /* fields omitted */ }

A builder for rigid-bodies.

Implementations

impl RigidBodyBuilder[src]

pub fn new(body_status: BodyStatus) -> RigidBodyBuilder[src]

Initialize a new builder for a rigid body which is either static, dynamic, or kinematic.

pub fn new_static() -> RigidBodyBuilder[src]

Initializes the builder of a new static rigid body.

pub fn new_kinematic() -> RigidBodyBuilder[src]

Initializes the builder of a new kinematic rigid body.

pub fn new_dynamic() -> RigidBodyBuilder[src]

Initializes the builder of a new dynamic rigid body.

pub fn gravity_scale(self, x: f32) -> RigidBodyBuilder[src]

Sets the scale applied to the gravity force affecting the rigid-body to be created.

pub fn dominance_group(self, group: i8) -> RigidBodyBuilder[src]

Sets the dominance group of this rigid-body.

pub fn translation(self, x: f32, y: f32, z: f32) -> RigidBodyBuilder[src]

Sets the initial translation of the rigid-body to be created.

pub fn rotation(
    self,
    angle: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> RigidBodyBuilder
[src]

Sets the initial orientation of the rigid-body to be created.

pub fn position(
    self,
    pos: Isometry<f32, Unit<Quaternion<f32>>, 3_usize>
) -> RigidBodyBuilder
[src]

Sets the initial position (translation and orientation) of the rigid-body to be created.

pub fn user_data(self, data: u128) -> RigidBodyBuilder[src]

An arbitrary user-defined 128-bit integer associated to the rigid-bodies built by this builder.

pub fn additional_mass_properties(
    self,
    props: MassProperties
) -> RigidBodyBuilder
[src]

Sets the additional mass properties of the rigid-body being built.

Note that “additional” means that the final mass properties of the rigid-bodies depends on the initial mass-properties of the rigid-body (set by this method) to which is added the contributions of all the colliders with non-zero density attached to this rigid-body.

Therefore, if you want your provided mass properties to be the final mass properties of your rigid-body, don’t attach colliders to it, or only attach colliders with densities equal to zero.

pub fn lock_translations(self) -> RigidBodyBuilder[src]

Prevents this rigid-body from translating because of forces.

pub fn lock_rotations(self) -> RigidBodyBuilder[src]

Prevents this rigid-body from rotating because of forces.

pub fn restrict_rotations(
    self,
    allow_rotations_x: bool,
    allow_rotations_y: bool,
    allow_rotations_z: bool
) -> RigidBodyBuilder
[src]

Only allow rotations of this rigid-body around specific coordinate axes.

pub fn additional_mass(self, mass: f32) -> RigidBodyBuilder[src]

Sets the additional mass of the rigid-body being built.

This is only the “additional” mass because the total mass of the rigid-body is equal to the sum of this additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body.

pub fn mass(self, mass: f32) -> RigidBodyBuilder[src]

👎 Deprecated:

renamed to additional_mass.

Sets the additional mass of the rigid-body being built.

This is only the “additional” mass because the total mass of the rigid-body is equal to the sum of this additional mass and the mass computed from the colliders (with non-zero densities) attached to this rigid-body.

pub fn additional_principal_angular_inertia(
    self,
    inertia: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> RigidBodyBuilder
[src]

Sets the additional principal angular inertia of this rigid-body.

This is only the “additional” angular inertia because the total angular inertia of the rigid-body is equal to the sum of this additional value and the angular inertia computed from the colliders (with non-zero densities) attached to this rigid-body.

pub fn principal_angular_inertia(
    self,
    inertia: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> RigidBodyBuilder
[src]

👎 Deprecated:

renamed to additional_principal_angular_inertia.

Sets the principal angular inertia of this rigid-body.

pub fn principal_inertia(
    self,
    inertia: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> RigidBodyBuilder
[src]

👎 Deprecated:

renamed to additional_principal_angular_inertia.

Use self.principal_angular_inertia instead.

pub fn linear_damping(self, factor: f32) -> RigidBodyBuilder[src]

Sets the damping factor for the linear part of the rigid-body motion.

The higher the linear damping factor is, the more quickly the rigid-body will slow-down its translational movement.

pub fn angular_damping(self, factor: f32) -> RigidBodyBuilder[src]

Sets the damping factor for the angular part of the rigid-body motion.

The higher the angular damping factor is, the more quickly the rigid-body will slow-down its rotational movement.

pub fn linvel(self, x: f32, y: f32, z: f32) -> RigidBodyBuilder[src]

Sets the initial linear velocity of the rigid-body to be created.

pub fn angvel(
    self,
    angvel: Matrix<f32, Const<{_: usize}>, Const<1_usize>, ArrayStorage<f32, 3_usize, 1_usize>>
) -> RigidBodyBuilder
[src]

Sets the initial angular velocity of the rigid-body to be created.

pub fn can_sleep(self, can_sleep: bool) -> RigidBodyBuilder[src]

Sets whether or not the rigid-body to be created can sleep if it reaches a dynamic equilibrium.

pub fn ccd_enabled(self, enabled: bool) -> RigidBodyBuilder[src]

Enabled continuous collision-detection for this rigid-body.

pub fn sleeping(self, sleeping: bool) -> RigidBodyBuilder[src]

Sets whether or not the rigid-body is to be created asleep.

pub fn build(&self) -> RigidBody[src]

Build a new rigid-body with the parameters configured with this builder.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> Downcast for T where
    T: Any

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

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

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

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

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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>,