Struct physx::rigid_dynamic::PxRigidDynamic
source · [−]#[repr(transparent)]pub struct PxRigidDynamic<D, Geom: Shape> { /* private fields */ }
Expand description
A new type wrapper for PxRigidDynamic. Parametrized by it’s user data type, and the type of it’s Shapes.
Trait Implementations
sourceimpl<P, D, Geom: Shape> Class<P> for PxRigidDynamic<D, Geom>where
PxRigidDynamic: Class<P>,
impl<P, D, Geom: Shape> Class<P> for PxRigidDynamic<D, Geom>where
PxRigidDynamic: Class<P>,
sourcefn as_ptr(&self) -> *const P
fn as_ptr(&self) -> *const P
Returns a raw const pointer to the wrapped type.
Retrieving a raw pointer is safe. However, pretty much any use of a raw pointer is unsafe.
In particular: this pointer should not be used to construct a second owning wrapper around the pointer. Read more
sourcefn as_mut_ptr(&mut self) -> *mut P
fn as_mut_ptr(&mut self) -> *mut P
Returns a raw mut pointer to the wrapped type.
Retrieving a raw pointer is safe. However, pretty much any use of a raw pointer is unsafe.
In particular: this pointer should not be used to construct a second owning wrapper around the pointer. Read more
sourceimpl<D, Geom: Shape> Drop for PxRigidDynamic<D, Geom>
impl<D, Geom: Shape> Drop for PxRigidDynamic<D, Geom>
sourceimpl<D, Geom: Shape> RigidActor for PxRigidDynamic<D, Geom>
impl<D, Geom: Shape> RigidActor for PxRigidDynamic<D, Geom>
type Shape = Geom
sourcefn get_nb_constraints(&self) -> u32
fn get_nb_constraints(&self) -> u32
Get the number of constraints on this rigid actor.
sourcefn get_constraints(&mut self) -> Vec<&mut Constraint>
fn get_constraints(&mut self) -> Vec<&mut Constraint>
Get the constraints effecting this rigid actor.
sourcefn get_global_pose(&self) -> PxTransform
fn get_global_pose(&self) -> PxTransform
Get the global pose of this rigid actor. The scale is implicitly 1.0.
sourcefn get_global_position(&self) -> PxVec3
fn get_global_position(&self) -> PxVec3
Get the global pose of this rigid actor.
sourcefn get_global_rotation(&self) -> PxQuat
fn get_global_rotation(&self) -> PxQuat
Get the global rotation of this rigid actor.
sourcefn set_global_pose(&mut self, pose: &PxTransform, autowake: bool)
fn set_global_pose(&mut self, pose: &PxTransform, autowake: bool)
Set the global pose of this rigid actor
sourcefn get_nb_shapes(&self) -> u32
fn get_nb_shapes(&self) -> u32
Get number of attached shapes
sourcefn get_shapes(&self) -> Vec<&Self::Shape>
fn get_shapes(&self) -> Vec<&Self::Shape>
Get a reference to every Shape attached to this actor.
sourcefn get_shapes_mut(&mut self) -> Vec<&mut Self::Shape>
fn get_shapes_mut(&mut self) -> Vec<&mut Self::Shape>
Get a mutable reference to every Shape attached to this actor.
sourcefn set_collision_filter(
&mut self,
this_layers: BitFlags<CollisionLayer>,
other_layers: BitFlags<CollisionLayer>,
word3: u32,
word4: u32
)
fn set_collision_filter(
&mut self,
this_layers: BitFlags<CollisionLayer>,
other_layers: BitFlags<CollisionLayer>,
word3: u32,
word4: u32
)
Set the collision filter. Collisions will only occur if this_layers & other_layers != 0.
sourcefn set_query_filter(&mut self, this_layers: BitFlags<CollisionLayer>)
fn set_query_filter(&mut self, this_layers: BitFlags<CollisionLayer>)
Set the query filter. Queries will only find this item if queried with one of the flags.
sourcefn attach_shape(&mut self, shape: &mut Self::Shape) -> bool
fn attach_shape(&mut self, shape: &mut Self::Shape) -> bool
Attach a shape.
sourcefn detach_shape(&mut self, shape: &mut Self::Shape)
fn detach_shape(&mut self, shape: &mut Self::Shape)
Detach a shape.
sourceimpl<D, Geom: Shape> RigidDynamic for PxRigidDynamic<D, Geom>
impl<D, Geom: Shape> RigidDynamic for PxRigidDynamic<D, Geom>
sourcefn 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>>
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.
sourceunsafe fn from_raw(
ptr: *mut PxRigidDynamic,
user_data: Self::UserData
) -> Option<Owner<Self>>
unsafe fn from_raw(
ptr: *mut PxRigidDynamic,
user_data: Self::UserData
) -> Option<Owner<Self>>
Create a new Owner wrapper around a raw pointer. Read more
sourcefn get_user_data(&self) -> &Self::UserData
fn get_user_data(&self) -> &Self::UserData
Get the user data.
sourcefn get_user_data_mut(&mut self) -> &mut Self::UserData
fn get_user_data_mut(&mut self) -> &mut Self::UserData
Get the user data.
sourcefn get_contact_report_threshold(&self) -> f32
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. Read more
sourcefn get_kinematic_target(&self) -> Option<PxTransform>
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. Read more
sourcefn get_rigid_dynamic_lock_flags(&self) -> RigidDynamicLockFlags
fn get_rigid_dynamic_lock_flags(&self) -> RigidDynamicLockFlags
Get the lock flags.
sourcefn get_sleep_threshold(&self) -> f32
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. Read more
sourcefn get_solver_iteration_counts(&self) -> (u32, u32)
fn get_solver_iteration_counts(&self) -> (u32, u32)
Get the number of (position, velocity) iterations done by the solver.
sourcefn get_stabilization_threshold(&self) -> f32
fn get_stabilization_threshold(&self) -> f32
Get the stabilization threshold. Actors with mass-normalized kinetic energy may participate in stabilization.
sourcefn get_wake_counter(&self) -> f32
fn get_wake_counter(&self) -> f32
Get the wake counter.
sourcefn is_sleeping(&self) -> bool
fn is_sleeping(&self) -> bool
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. Read more
sourcefn put_to_sleep(&mut self)
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. Read more
sourcefn set_contact_report_threshold(&mut self, threshold: f32)
fn set_contact_report_threshold(&mut self, threshold: f32)
Set the contact report threshold, used when determining if a contact report should be generated.
sourcefn set_kinematic_target(&mut self, target: &PxTransform)
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. Read moresourcefn set_rigid_dynamic_lock_flag(&mut self, flag: RigidDynamicLockFlag, value: bool)
fn set_rigid_dynamic_lock_flag(&mut self, flag: RigidDynamicLockFlag, value: bool)
Set a lock flag, preventing movement along or about an axis.
sourcefn set_rigid_dynamic_lock_flags(&mut self, flags: RigidDynamicLockFlags)
fn set_rigid_dynamic_lock_flags(&mut self, flags: RigidDynamicLockFlags)
Set the lock flags.
sourcefn set_sleep_threshold(&mut self, threshold: f32)
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 .. ]. Read more
sourcefn set_solver_iteration_counts(
&mut self,
min_position_iterations: u32,
min_velocity_iterations: u32
)
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].
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. Read more
sourcefn set_stabilization_threshold(&mut self, threshold: f32)
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. Read more
sourcefn set_wake_counter(&mut self, wake_counter: f32)
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. Read more
impl<D: Send, Geom: Shape + Send> Send for PxRigidDynamic<D, Geom>
impl<D: Sync, Geom: Shape + Sync> Sync for PxRigidDynamic<D, Geom>
Auto Trait Implementations
impl<D, Geom> RefUnwindSafe for PxRigidDynamic<D, Geom>where
D: RefUnwindSafe,
Geom: RefUnwindSafe,
impl<D, Geom> Unpin for PxRigidDynamic<D, Geom>where
D: Unpin,
Geom: Unpin,
impl<D, Geom> UnwindSafe for PxRigidDynamic<D, Geom>where
D: UnwindSafe,
Geom: UnwindSafe,
Blanket Implementations
sourceimpl<T> Actor for Twhere
T: Class<PxActor> + Base,
impl<T> Actor for Twhere
T: Class<PxActor> + Base,
sourcefn get_world_bounds(&self, inflation: f32) -> PxBounds3
fn get_world_bounds(&self, inflation: f32) -> PxBounds3
Get the world bounds of this actor
sourcefn set_actor_flag(&mut self, flag: ActorFlag, value: bool)
fn set_actor_flag(&mut self, flag: ActorFlag, value: bool)
Set a flag on this actor
sourcefn set_actor_flags(&mut self, flags: BitFlags<ActorFlag>)
fn set_actor_flags(&mut self, flags: BitFlags<ActorFlag>)
Set the flags to the provided value
sourcefn get_actor_flags(&self) -> BitFlags<ActorFlag>
fn get_actor_flags(&self) -> BitFlags<ActorFlag>
Get all actor flags
sourcefn set_dominance_group(&mut self, group: u8)
fn set_dominance_group(&mut self, group: u8)
Set the dominance group
sourcefn get_dominance_group(&self) -> u8
fn get_dominance_group(&self) -> u8
Read the dominance group
sourcefn set_owner_client(&mut self, client: u8)
fn set_owner_client(&mut self, client: u8)
Set the owner client of this actor
sourcefn get_owner_client(&self) -> u8
fn get_owner_client(&self) -> u8
Read the owner client of this actor
sourcefn enable_visualization(&mut self, enable: bool)
fn enable_visualization(&mut self, enable: bool)
Enable visualization of this actor
sourcefn enable_gravity(&mut self, enable: bool)
fn enable_gravity(&mut self, enable: bool)
set gravity state
sourceimpl<T> Base for Twhere
T: Class<PxBase>,
impl<T> Base for Twhere
T: Class<PxBase>,
sourcefn get_concrete_type_name(&self) -> Option<&str>
fn get_concrete_type_name(&self) -> Option<&str>
Get the name of the real type referenced by this pointer, or None if the returned string is not valid
sourcefn get_concrete_type(&self) -> ConcreteType
fn get_concrete_type(&self) -> ConcreteType
Returns an enumerated value identifying the type. This may return ConcreteType::Undefined
in surprising situations, notably this does not seem to work with
get_active_actors
. Use
get_type
for actors if possible. Read moresourcefn set_base_flag(&mut self, flag: BaseFlag, value: bool)
fn set_base_flag(&mut self, flag: BaseFlag, value: bool)
Set or unset the specified flag on this object.
sourcefn set_base_flags(&mut self, in_flags: BitFlags<BaseFlag>)
fn set_base_flags(&mut self, in_flags: BitFlags<BaseFlag>)
Set the BaseFlags of this object. Note that replaces all flags currently
on the object. Use
set_base_flag
to set individual flags. Read moresourcefn get_base_flags(&self) -> BitFlags<BaseFlag>
fn get_base_flags(&self) -> BitFlags<BaseFlag>
Read the BaseFlags of this object
sourcefn is_releasable(&self) -> bool
fn is_releasable(&self) -> bool
Returns true if this object can be released, i.e., it is not subordinate.
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> RigidBody for Twhere
T: Class<PxRigidBody> + RigidActor,
impl<T> RigidBody for Twhere
T: Class<PxRigidBody> + RigidActor,
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. Read more
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. Read moresourcefn 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. Read more
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. Read more
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. Read more
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. Read more
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). Read more
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). Read more
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. Read moresourcefn 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. Read moresourcefn 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
. Read moresourcefn 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
. Read moresourcefn 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. Read more
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