[][src]Trait physx::rigid_dynamic::RigidDynamic

pub trait RigidDynamic: Class<PxRigidDynamic> + RigidBody + UserData {
    pub 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>> { ... }
pub unsafe fn from_raw(
        ptr: *mut PxRigidDynamic,
        user_data: Self::UserData
    ) -> Option<Owner<Self>> { ... }
pub fn get_user_data(&self) -> &Self::UserData { ... }
pub fn get_user_data_mut(&mut self) -> &mut Self::UserData { ... }
pub fn get_contact_report_threshold(&self) -> f32 { ... }
pub fn get_kinematic_target(&self) -> Option<PxTransform> { ... }
pub fn get_rigid_dynamic_lock_flags(&self) -> RigidDynamicLockFlags { ... }
pub fn get_sleep_threshold(&self) -> f32 { ... }
pub fn get_solver_iteration_counts(&self) -> (u32, u32) { ... }
pub fn get_stabilization_threshold(&self) -> f32 { ... }
pub fn get_wake_counter(&self) -> f32 { ... }
pub fn is_sleeping(&self) -> bool { ... }
pub fn put_to_sleep(&mut self) { ... }
pub fn set_contact_report_threshold(&mut self, threshold: f32) { ... }
pub fn set_kinematic_target(&mut self, target: &PxTransform) { ... }
pub fn set_rigid_dynamic_lock_flag(
        &mut self,
        flag: RigidDynamicLockFlag,
        value: bool
    ) { ... }
pub fn set_rigid_dynamic_lock_flags(&mut self, flags: RigidDynamicLockFlags) { ... }
pub fn set_sleep_threshold(&mut self, threshold: f32) { ... }
pub fn set_solver_iteration_counts(
        &mut self,
        min_position_iterations: u32,
        min_velocity_iterations: u32
    ) { ... }
pub fn set_stabilization_threshold(&mut self, threshold: f32) { ... }
pub fn set_wake_counter(&mut self, wake_counter: f32) { ... }
pub fn wake_up(&mut self) { ... } }

Provided methods

pub 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>>
[src]

Create a new RigidDynamic.

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

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.

pub fn get_user_data(&self) -> &Self::UserData[src]

Get the user data.

pub fn get_user_data_mut(&mut self) -> &mut Self::UserData[src]

Get the user data.

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

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.

pub fn get_kinematic_target(&self) -> Option<PxTransform>[src]

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

pub fn get_rigid_dynamic_lock_flags(&self) -> RigidDynamicLockFlags[src]

Get the lock flags.

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

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

pub fn get_solver_iteration_counts(&self) -> (u32, u32)[src]

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

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

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

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

Get the wake counter.

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

Returns true if the actor is sleeping. Sleeping actors are not simulated. If an actor is sleeping, it's linear and angular velocities are zero, no force or torque updates are pending, and the wake counter is zero.

pub fn put_to_sleep(&mut self)[src]

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.

pub fn set_contact_report_threshold(&mut self, threshold: f32)[src]

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

pub fn set_kinematic_target(&mut self, target: &PxTransform)[src]

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.

pub fn set_rigid_dynamic_lock_flag(
    &mut self,
    flag: RigidDynamicLockFlag,
    value: bool
)
[src]

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

pub fn set_rigid_dynamic_lock_flags(&mut self, flags: RigidDynamicLockFlags)[src]

Set the lock flags.

pub fn set_sleep_threshold(&mut self, threshold: f32)[src]

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 .. ].

pub fn set_solver_iteration_counts(
    &mut self,
    min_position_iterations: u32,
    min_velocity_iterations: u32
)
[src]

Set the number of solver iterations for the position and velocity solvers clamped to range [1..=255]. Defualt 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.

pub fn set_stabilization_threshold(&mut self, threshold: f32)[src]

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

pub fn set_wake_counter(&mut self, wake_counter: f32)[src]

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.

pub fn wake_up(&mut self)[src]

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

Loading content...

Implementors

impl<D, Geom: Shape> RigidDynamic for PxRigidDynamic<D, Geom>[src]

Loading content...