Struct physx::actor::ActorMap

source ·
pub struct ActorMap<L, S, D>where
    L: ArticulationLink,
    S: RigidStatic,
    D: RigidDynamic,{ /* private fields */ }
Expand description

A wrapper for PxActor or PxRigidActor objects that implements RigidActor.

It is parametrized by the ArticulationLink, RigidStatic, and RigidDynamic types, use as_articulation_link and co. or cast_map to cast to them safely.

Implementations§

source§

impl<L, S, D> ActorMap<L, S, D>where L: ArticulationLink, S: RigidStatic, D: RigidDynamic,

source

pub fn cast_map<'a, Ret, ALFn, RSFn, RDFn>( &'a self, articulation_link_fn: ALFn, rigid_static_fn: RSFn, rigid_dynamic_fn: RDFn ) -> Retwhere ALFn: FnMut(&'a L) -> Ret, RSFn: FnMut(&'a S) -> Ret, RDFn: FnMut(&'a D) -> Ret,

Cast to the most-derived type as determined by get_type, which returns the ActorType. Because this does not use get_concrete_type, this method does not have the safety concerns of the other cast_maps, and a try_cast_map method is not needed.

source

pub fn cast_map_mut<'a, Ret, ALFn, RSFn, RDFn>( &'a mut self, articulation_link_fn: ALFn, rigid_static_fn: RSFn, rigid_dynamic_fn: RDFn ) -> Retwhere ALFn: FnMut(&'a mut L) -> Ret, RSFn: FnMut(&'a mut S) -> Ret, RDFn: FnMut(&'a mut D) -> Ret,

Cast to the most-derived type as determined by get_type, which returns the ActorType. Because this does not use get_concrete_type, this method does not have the safety concerns of the other cast_maps, and a try_cast_map method is not needed.

source

pub fn as_rigid_dynamic(&self) -> Option<&D>

Tries to cast reference to RigidDynamic.

source

pub fn as_rigid_dynamic_mut(&mut self) -> Option<&mut D>

Tries to cast mutable reference to RigidDynamic.

source

pub fn as_rigid_static(&self) -> Option<&S>

Tries to cast reference to RigidStatic.

source

pub fn as_rigid_static_mut(&mut self) -> Option<&mut S>

Tries to cast mutable reference to RigidStatic.

Tries to cast reference to ArticulationLink.

Tries to cast mutable reference to ArticulationLink.

Trait Implementations§

source§

impl<P, L, S, D> Class<P> for ActorMap<L, S, D>where PxRigidActor: Class<P>, L: ArticulationLink, S: RigidStatic, D: RigidDynamic,

source§

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.
source§

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.
source§

impl<L, S, D> RigidActor for ActorMap<L, S, D>where L: ArticulationLink, S: RigidStatic, D: RigidDynamic,

§

type Shape = <L as RigidActor>::Shape

source§

fn get_nb_constraints(&self) -> u32

Get the number of constraints on this rigid actor.
source§

fn get_constraints(&mut self) -> Vec<&mut Constraint>

Get the constraints effecting this rigid actor.
source§

fn get_global_pose(&self) -> PxTransform

Get the global pose of this rigid actor. The scale is implicitly 1.0.
source§

fn get_global_position(&self) -> PxVec3

Get the global pose of this rigid actor.
source§

fn get_global_rotation(&self) -> PxQuat

Get the global rotation of this rigid actor.
source§

fn set_global_pose(&mut self, pose: &PxTransform, autowake: bool)

Set the global pose of this rigid actor
source§

fn get_nb_shapes(&self) -> u32

Get number of attached shapes
source§

fn get_shapes(&self) -> Vec<&Self::Shape>

Get a reference to every Shape attached to this actor.
source§

fn get_shapes_mut(&mut self) -> Vec<&mut Self::Shape>

Get a mutable reference to every Shape attached to this actor.
source§

fn set_collision_filter( &mut self, this_layers: CollisionLayers, other_layers: CollisionLayers, word3: u32, word4: u32 )

Set the collision filter. Collisions will only occur if this_layers & other_layers != 0.
source§

fn set_query_filter(&mut self, this_layers: CollisionLayers)

Set the query filter. Queries will only find this item if queried with one of the flags.
source§

fn attach_shape(&mut self, shape: &mut Self::Shape) -> bool

Attach a shape.
source§

fn detach_shape(&mut self, shape: &mut Self::Shape)

Detach a shape.

Auto Trait Implementations§

§

impl<L, S, D> RefUnwindSafe for ActorMap<L, S, D>where D: RefUnwindSafe, L: RefUnwindSafe, S: RefUnwindSafe,

§

impl<L, S, D> !Send for ActorMap<L, S, D>

§

impl<L, S, D> !Sync for ActorMap<L, S, D>

§

impl<L, S, D> Unpin for ActorMap<L, S, D>

§

impl<L, S, D> UnwindSafe for ActorMap<L, S, D>where D: RefUnwindSafe, L: RefUnwindSafe, S: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Actor for Twhere T: Class<PxActor> + Base,

source§

fn get_type(&self) -> ActorType

Get the concrete type of the actor
source§

fn get_world_bounds(&self, inflation: f32) -> PxBounds3

Get the world bounds of this actor
source§

fn set_actor_flag(&mut self, flag: ActorFlag, value: bool)

Set a flag on this actor
source§

fn set_actor_flags(&mut self, flags: ActorFlags)

Set the flags to the provided value
source§

fn get_actor_flags(&self) -> ActorFlags

Get all actor flags
source§

fn set_dominance_group(&mut self, group: u8)

Set the dominance group
source§

fn get_dominance_group(&self) -> u8

Read the dominance group
source§

fn set_owner_client(&mut self, client: u8)

Set the owner client of this actor
source§

fn get_owner_client(&self) -> u8

Read the owner client of this actor
source§

fn enable_visualization(&mut self, enable: bool)

Enable visualization of this actor
source§

fn enable_gravity(&mut self, enable: bool)

set gravity state
source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Base for Twhere T: Class<PxBase>,

source§

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
source§

fn get_concrete_type(&self) -> ConcreteType

Returns an enumerated value identifying the type. Read more
source§

fn set_base_flag(&mut self, flag: BaseFlag, value: bool)

Set or unset the specified flag on this object.
source§

fn set_base_flags(&mut self, in_flags: BaseFlags)

Set the BaseFlags of this object. Note that replaces all flags currently on the object. Use set_base_flag to set individual flags.
source§

fn get_base_flags(&self) -> BaseFlags

Read the BaseFlags of this object
source§

fn is_releasable(&self) -> bool

Returns true if this object can be released, i.e., it is not subordinate.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> RigidBody for Twhere T: Class<PxRigidBody> + RigidActor,

source§

fn set_mass(&mut self, mass: f32)

Set the mass of this body
source§

fn get_angular_velocity(&self) -> PxVec3

Get the angular velocity.
source§

fn get_linear_velocity(&self) -> PxVec3

Get the linear velocity.
source§

fn get_velocities(&self) -> (PxVec3, PxVec3)

Get the (linear, angular) velocities.
source§

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.
source§

fn get_c_mass_local_pose(&self) -> PxTransform

Get the pose of the center of mass.
source§

fn get_mass(&self) -> f32

Get the mass of the body.
source§

fn get_inv_mass(&self) -> f32

Get the inverse of the mass of this body.
source§

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 PxArticulationLinks.
source§

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.
source§

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.
source§

fn set_linear_damping(&mut self, lin_damp: f32)

Sets the linear damping. Zero represents no damping. Values clamped to [0.0 .. ].
source§

fn get_linear_damping(&self) -> f32

Gets the linear damping.
source§

fn set_angular_damping(&mut self, ang_damp: f32)

Sets the angular damping. Zero represents no damping. Values clamped to (0.0, .. ).
source§

fn get_angular_damping(&self) -> f32

Get the angular damping.
source§

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).
source§

fn get_max_angular_velocity(&self) -> f32

Get the maximum angular velocity.
source§

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).
source§

fn get_max_linear_velocity(&self) -> f32

Get the maximum linear velocity.
source§

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.
source§

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.
source§

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.
source§

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.
source§

fn set_force_and_torque( &mut self, force: &PxVec3, torque: &PxVec3, mode: ForceMode )

Set the force and torque accumulators.
source§

fn set_rigid_body_flag(&mut self, flag: RigidBodyFlag, value: bool)

Set a rigid body flag.
source§

fn set_rigid_body_flags(&mut self, flags: RigidBodyFlags)

Set all the rigid body flags.
source§

fn get_rigid_body_flags(&self) -> RigidBodyFlags

Get the rigid body flags.
source§

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.
source§

fn get_min_ccd_advance_coefficient(&self) -> f32

Get the CCD advance coefficient.
source§

fn set_max_depenetration_velocity(&mut self, bias_clamp: f32)

sET the maximum allowed depenetration velocity
source§

fn get_max_depenetration_velocity(&self) -> f32

Get the maximum allowed depenetration velocity
source§

fn set_max_contact_impulse(&mut self, max_impulse: f32)

Set the max number of contact impulses this body may experience
source§

fn get_max_contact_impulse(&self) -> f32

Get the max number of contact impulses this body may experience
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.