Trait physx::rigid_body::RigidBody
source · [−]pub trait RigidBody: Class<PxRigidBody> + RigidActor {
Show 35 methods
fn set_mass(&mut self, mass: f32) { ... }
fn get_angular_velocity(&self) -> PxVec3 { ... }
fn get_linear_velocity(&self) -> PxVec3 { ... }
fn get_velocities(&self) -> (PxVec3, PxVec3) { ... }
fn set_c_mass_local_pose(&mut self, pose: &PxTransform) { ... }
fn get_c_mass_local_pose(&self) -> PxTransform { ... }
fn get_mass(&self) -> f32 { ... }
fn get_inv_mass(&self) -> f32 { ... }
fn set_mass_space_inertia_tensor(&mut self, m: &PxVec3) { ... }
fn get_mass_space_inertia_tensor(&self) -> PxVec3 { ... }
fn get_mass_space_inv_inertia_tensor(&self) -> PxVec3 { ... }
fn set_linear_damping(&mut self, lin_damp: f32) { ... }
fn get_linear_damping(&self) -> f32 { ... }
fn set_angular_damping(&mut self, ang_damp: f32) { ... }
fn get_angular_damping(&self) -> f32 { ... }
fn set_linear_velocity(&mut self, lin_vel: &PxVec3, autowake: bool) { ... }
fn set_angular_velocity(&mut self, ang_vel: &PxVec3, autowake: bool) { ... }
fn set_max_angular_velocity(&mut self, max_ang_vel: f32) { ... }
fn get_max_angular_velocity(&self) -> f32 { ... }
fn set_max_linear_velocity(&mut self, max_lin_vel: f32) { ... }
fn get_max_linear_velocity(&self) -> f32 { ... }
fn add_force(&mut self, force: &PxVec3, mode: ForceMode, autowake: bool) { ... }
fn add_torque(&mut self, torque: &PxVec3, mode: ForceMode, autowake: bool) { ... }
fn clear_force(&mut self, mode: ForceMode) { ... }
fn clear_torque(&mut self, mode: ForceMode) { ... }
fn set_force_and_torque(
&mut self,
force: &PxVec3,
torque: &PxVec3,
mode: ForceMode
) { ... }
fn set_rigid_body_flag(&mut self, flag: RigidBodyFlag, value: bool) { ... }
fn set_rigid_body_flags(&mut self, flags: RigidBodyFlags) { ... }
fn get_rigid_body_flags(&self) -> RigidBodyFlags { ... }
fn set_min_ccd_advance_coefficient(&mut self, advance_coefficient: f32) { ... }
fn get_min_ccd_advance_coefficient(&self) -> f32 { ... }
fn set_max_depenetration_velocity(&mut self, bias_clamp: f32) { ... }
fn get_max_depenetration_velocity(&self) -> f32 { ... }
fn set_max_contact_impulse(&mut self, max_impulse: f32) { ... }
fn get_max_contact_impulse(&self) -> f32 { ... }
}
Provided Methods
sourcefn get_angular_velocity(&self) -> PxVec3
fn get_angular_velocity(&self) -> PxVec3
Get the angular velocity.
sourcefn get_linear_velocity(&self) -> PxVec3
fn get_linear_velocity(&self) -> PxVec3
Get the linear velocity.
sourcefn get_velocities(&self) -> (PxVec3, PxVec3)
fn get_velocities(&self) -> (PxVec3, PxVec3)
Get the (linear, angular) velocities.
sourcefn set_c_mass_local_pose(&mut self, pose: &PxTransform)
fn set_c_mass_local_pose(&mut self, pose: &PxTransform)
Set the pose of the position and orientation of the center of mass. This does not move tha body, Setting the center of mass too far away may cause instability.
sourcefn get_c_mass_local_pose(&self) -> PxTransform
fn get_c_mass_local_pose(&self) -> PxTransform
Get the pose of the center of mass.
sourcefn get_inv_mass(&self) -> f32
fn get_inv_mass(&self) -> f32
Get the inverse of the mass of this body.
sourcefn set_mass_space_inertia_tensor(&mut self, m: &PxVec3)
fn set_mass_space_inertia_tensor(&mut self, m: &PxVec3)
Sets the inertia tensor using mass space coordinates. Non-diagonal space inertia tensors
must be diagonalized, only the diagonal is passed in. The tensor elements must be non-negative.
Values of 0 represent infinite inertia along that axis, and are not permitted for PxArticulationLink
s.
sourcefn get_mass_space_inertia_tensor(&self) -> PxVec3
fn get_mass_space_inertia_tensor(&self) -> PxVec3
Gets the diagonal of the inertia tensor relative to the body’s mass coordinate frame. A value of 0 represents infinite inertia along that axis.
sourcefn get_mass_space_inv_inertia_tensor(&self) -> PxVec3
fn get_mass_space_inv_inertia_tensor(&self) -> PxVec3
Gets the diagonal of the inverse inertia tensor relative to the body’s mass coordinate frame. A value of 0 represents infinite inertia along that axis.
sourcefn set_linear_damping(&mut self, lin_damp: f32)
fn set_linear_damping(&mut self, lin_damp: f32)
Sets the linear damping. Zero represents no damping. Values clamped to [0.0 .. ].
sourcefn get_linear_damping(&self) -> f32
fn get_linear_damping(&self) -> f32
Gets the linear damping.
sourcefn set_angular_damping(&mut self, ang_damp: f32)
fn set_angular_damping(&mut self, ang_damp: f32)
Sets the angular damping. Zero represents no damping. Values clamped to (0.0, .. ).
sourcefn get_angular_damping(&self) -> f32
fn get_angular_damping(&self) -> f32
Get the angular damping.
sourcefn set_linear_velocity(&mut self, lin_vel: &PxVec3, autowake: bool)
fn set_linear_velocity(&mut self, lin_vel: &PxVec3, autowake: bool)
Set the linear velocity. Continuously setting this will override the effects of gravity or friction because forces effect the body via velocity. If ActorFlag::DisableSimulation is set, this does nothing, otherwise this call will wake the actor.
sourcefn set_angular_velocity(&mut self, ang_vel: &PxVec3, autowake: bool)
fn set_angular_velocity(&mut self, ang_vel: &PxVec3, autowake: bool)
Set the angular velocity. Continuously setting this will override the effects of gravity or friction because forces effect the body via velocity. If ActorFlag::DisableSimulation is set, this does nothing, otherwise this call will wake the actor.
sourcefn set_max_angular_velocity(&mut self, max_ang_vel: f32)
fn set_max_angular_velocity(&mut self, max_ang_vel: f32)
Set the maximum angular velocity. Very rapid rotation can cause simulation errors, setting this value will clamp velocty before the solver is ran (so velocty may briefly exceed this value).
sourcefn get_max_angular_velocity(&self) -> f32
fn get_max_angular_velocity(&self) -> f32
Get the maximum angular velocity.
sourcefn set_max_linear_velocity(&mut self, max_lin_vel: f32)
fn set_max_linear_velocity(&mut self, max_lin_vel: f32)
Set the maximum linear velocity. Very rapid movement can cause simulation errors, setting this value will clamp velocty before the solver is ran (so velocty may briefly exceed this value).
sourcefn get_max_linear_velocity(&self) -> f32
fn get_max_linear_velocity(&self) -> f32
Get the maximum linear velocity.
sourcefn add_force(&mut self, force: &PxVec3, mode: ForceMode, autowake: bool)
fn add_force(&mut self, force: &PxVec3, mode: ForceMode, autowake: bool)
Apply a force to the actor. This will not cause torque. ForceMode determines how this force is applied.
ForceMode::Acceleration
and ForceMode::VelocityChange
directly effect the acceleration and velocity change
accumulators. ForceMode::Force
and ForceMode::Impulse
are multiplied by inverse mass first.
sourcefn add_torque(&mut self, torque: &PxVec3, mode: ForceMode, autowake: bool)
fn add_torque(&mut self, torque: &PxVec3, mode: ForceMode, autowake: bool)
Apply a torque to the actor. ForceMode determines how this force is applied. ForceMode::Acceleration
and ForceMode::VelocityChange
directly effect the angular acceleration and angular velocity change
accumulators. ForceMode::Force
and ForceMode::Impulse
are multiplied by inverse mass first.
sourcefn clear_force(&mut self, mode: ForceMode)
fn clear_force(&mut self, mode: ForceMode)
Clear the accumulated acceleration or velocity change. ForceMode::Acceleration
and ForceMode::Force
clear the same accumulator, as do ForceMode::VelocityChange
and ForceMode::Impulse
.
sourcefn clear_torque(&mut self, mode: ForceMode)
fn clear_torque(&mut self, mode: ForceMode)
Clear the accumulated angular acceleration or angular velocity change. ForceMode::Acceleration
and ForceMode::Force
clear the same accumulator, as do ForceMode::VelocityChange
and ForceMode::Impulse
.
sourcefn set_force_and_torque(
&mut self,
force: &PxVec3,
torque: &PxVec3,
mode: ForceMode
)
fn set_force_and_torque(
&mut self,
force: &PxVec3,
torque: &PxVec3,
mode: ForceMode
)
Set the force and torque accumulators.
sourcefn set_rigid_body_flag(&mut self, flag: RigidBodyFlag, value: bool)
fn set_rigid_body_flag(&mut self, flag: RigidBodyFlag, value: bool)
Set a rigid body flag.
sourcefn set_rigid_body_flags(&mut self, flags: RigidBodyFlags)
fn set_rigid_body_flags(&mut self, flags: RigidBodyFlags)
Set all the rigid body flags.
sourcefn get_rigid_body_flags(&self) -> RigidBodyFlags
fn get_rigid_body_flags(&self) -> RigidBodyFlags
Get the rigid body flags.
sourcefn set_min_ccd_advance_coefficient(&mut self, advance_coefficient: f32)
fn set_min_ccd_advance_coefficient(&mut self, advance_coefficient: f32)
Set the CCD advance coefficient, clamped to range [0.0 ..= 1.0]. Default is 0.15. Values near 1.0 ensures that some will be advanced, but objects may slowly drift through eachother. Values near 0.0 will never drift through eachother, but may “jam” ie. not advance through time during a given CCD pass.
sourcefn get_min_ccd_advance_coefficient(&self) -> f32
fn get_min_ccd_advance_coefficient(&self) -> f32
Get the CCD advance coefficient.
sourcefn set_max_depenetration_velocity(&mut self, bias_clamp: f32)
fn set_max_depenetration_velocity(&mut self, bias_clamp: f32)
sET the maximum allowed depenetration velocity
sourcefn get_max_depenetration_velocity(&self) -> f32
fn get_max_depenetration_velocity(&self) -> f32
Get the maximum allowed depenetration velocity
sourcefn set_max_contact_impulse(&mut self, max_impulse: f32)
fn set_max_contact_impulse(&mut self, max_impulse: f32)
Set the max number of contact impulses this body may experience
sourcefn get_max_contact_impulse(&self) -> f32
fn get_max_contact_impulse(&self) -> f32
Get the max number of contact impulses this body may experience