pub trait RigidDynamic: Class<PxRigidDynamic> + RigidBody + UserData {
Show 24 methods // Provided methods fn new( physics: &mut impl Physics, transform: PxTransform, geometry: &impl Geometry, material: &mut <Self::Shape as Shape>::Material, density: f32, shape_transform: PxTransform, user_data: Self::UserData ) -> Option<Owner<Self>> { ... } unsafe fn from_raw( ptr: *mut PxRigidDynamic, user_data: Self::UserData ) -> Option<Owner<Self>> { ... } fn get_user_data(&self) -> &Self::UserData { ... } fn get_user_data_mut(&mut self) -> &mut Self::UserData { ... } fn set_linear_velocity(&mut self, lin_vel: &PxVec3, autowake: bool) { ... } fn set_angular_velocity(&mut self, ang_vel: &PxVec3, autowake: bool) { ... } fn get_contact_report_threshold(&self) -> f32 { ... } fn get_kinematic_target(&self) -> Option<PxTransform> { ... } fn get_rigid_dynamic_lock_flags(&self) -> RigidDynamicLockFlags { ... } fn get_sleep_threshold(&self) -> f32 { ... } fn get_solver_iteration_counts(&self) -> (u32, u32) { ... } fn get_stabilization_threshold(&self) -> f32 { ... } fn get_wake_counter(&self) -> f32 { ... } fn is_sleeping(&self) -> bool { ... } fn put_to_sleep(&mut self) { ... } fn set_contact_report_threshold(&mut self, threshold: f32) { ... } fn set_kinematic_target(&mut self, target: &PxTransform) { ... } fn set_rigid_dynamic_lock_flag( &mut self, flag: RigidDynamicLockFlag, value: bool ) { ... } fn set_rigid_dynamic_lock_flags(&mut self, flags: RigidDynamicLockFlags) { ... } fn set_sleep_threshold(&mut self, threshold: f32) { ... } fn set_solver_iteration_counts( &mut self, min_position_iterations: u32, min_velocity_iterations: u32 ) { ... } fn set_stabilization_threshold(&mut self, threshold: f32) { ... } fn set_wake_counter(&mut self, wake_counter: f32) { ... } fn wake_up(&mut self) { ... }
}

Provided Methods§

source

fn new( physics: &mut impl Physics, transform: PxTransform, geometry: &impl Geometry, material: &mut <Self::Shape as Shape>::Material, density: f32, shape_transform: PxTransform, user_data: Self::UserData ) -> Option<Owner<Self>>

Create a new RigidDynamic.

source

unsafe fn from_raw( ptr: *mut PxRigidDynamic, user_data: Self::UserData ) -> Option<Owner<Self>>

Create a new Owner wrapper around a raw pointer.

Safety

Owner’s own the pointer they wrap, using the pointer after dropping the Owner, or creating multiple Owners from the same pointer will cause UB. Use into_ptr to retrieve the pointer and consume the Owner without dropping the pointee. Initializes user data.

source

fn get_user_data(&self) -> &Self::UserData

Get the user data.

source

fn get_user_data_mut(&mut self) -> &mut Self::UserData

Get the user data.

source

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.

source

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.

source

fn get_contact_report_threshold(&self) -> f32

Get the contact report threshold.

If the force between two actors exceeds this threshold for either actor, a contact report will be generated in accordance with the filter shader.

source

fn get_kinematic_target(&self) -> Option<PxTransform>

Returns a copy of the target transform if the actor is knematically controlled and has a target set, otherwise it returns None.

source

fn get_rigid_dynamic_lock_flags(&self) -> RigidDynamicLockFlags

Get the lock flags.

source

fn get_sleep_threshold(&self) -> f32

Get the sleep threshold.

If the actor’s mass-normalized kinetic energy is below this value, the actor might go to sleep.

source

fn get_solver_iteration_counts(&self) -> (u32, u32)

Get the number of (position, velocity) iterations done by the solver.

source

fn get_stabilization_threshold(&self) -> f32

Get the stabilization threshold.

Actors with mass-normalized kinetic energy may participate in stabilization.

source

fn get_wake_counter(&self) -> f32

Get the wake counter.

source

fn is_sleeping(&self) -> bool

Returns true if the actor is sleeping.

Sleeping actors are not simulated. If an actor is sleeping, its linear and angular velocities are zero, no force or torque updates are pending, and the wake counter is zero.

source

fn put_to_sleep(&mut self)

Put the actor to sleep.

Pending force and torque is cleared, and the wake counter and linear and angular velocities are all set to zero.

source

fn set_contact_report_threshold(&mut self, threshold: f32)

Set the contact report threshold, used when determining if a contact report should be generated.

source

fn set_kinematic_target(&mut self, target: &PxTransform)

Set the kinematic target of the actor.

Set an actor as kinematic using RigidBodyFlag::Kinematic. The actor will have it’s velocity set such that it gets moved to the desired pose in a single timestep, then the velocity will be zeroed. Movement along a path requires continuous calls. Consecutive calls in a single frame will overwrite the prior.

source

fn set_rigid_dynamic_lock_flag(&mut self, flag: RigidDynamicLockFlag, value: bool)

Set a lock flag, preventing movement along or about an axis.

source

fn set_rigid_dynamic_lock_flags(&mut self, flags: RigidDynamicLockFlags)

Set the lock flags.

source

fn set_sleep_threshold(&mut self, threshold: f32)

Set the mass normalized kinetic energy under which an actor is a candidate for being slept.

Default is 5e-5f * PxTolerancesScale.speed ^ 2. Value is clamped to range [0.0 .. ].

source

fn set_solver_iteration_counts( &mut self, min_position_iterations: u32, min_velocity_iterations: u32 )

Set the number of solver iterations for the position and velocity solvers clamped to range [1..=255].

Default is position = 4 and velocity = 1. If bodies are oscillating, increase the position iterations. If bodies are being depenetrated too quickly, increase the velocity iterations.

source

fn set_stabilization_threshold(&mut self, threshold: f32)

Set the stabilization threshold.

Actors with mass-normalized kinetic energy above this value will not participate in stabilization.

source

fn set_wake_counter(&mut self, wake_counter: f32)

Sets the wake counter.

This is the minimum amount of time until an actor must spend below the sleep threshold before it is put to sleep. Setting this to a positive value will wake the actor.

Default is 0.4, value is in seconds.

source

fn wake_up(&mut self)

Wake the actor.

May wake touching actors. Sets the wake counter to the wake_counter_reset_value set at scene creation.

Implementors§

source§

impl<D, Geom: Shape> RigidDynamic for PxRigidDynamic<D, Geom>