#[repr(transparent)]pub struct PxPhysics<Geom: Shape> { /* private fields */ }
Expand description
A new type wrapper for PxPhysics. Parametrized by the type of the Shapes it can create.
Implementations
sourceimpl<Geom: Shape> PxPhysics<Geom>
impl<Geom: Shape> PxPhysics<Geom>
pub fn new(foundation: &mut impl Foundation) -> Option<Owner<Self>>
Trait Implementations
sourceimpl<T, Geom: Shape> Class<T> for PxPhysics<Geom> where
PxPhysics: Class<T>,
impl<T, Geom: Shape> Class<T> for PxPhysics<Geom> where
PxPhysics: Class<T>,
sourcefn as_ptr(&self) -> *const T
fn as_ptr(&self) -> *const T
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 T
fn as_mut_ptr(&mut self) -> *mut T
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<Geom: Shape> Physics for PxPhysics<Geom>
impl<Geom: Shape> Physics for PxPhysics<Geom>
type Shape = Geom
fn create<Desc: Descriptor<Self>>(&mut self, desc: Desc) -> Desc::Target
sourcefn create_scene<U, L, S, D, T, C, OC, OT, OCB, OWS, OA>(
&mut self,
scene_descriptor: SceneDescriptor<U, L, S, D, T, C, OC, OT, OCB, OWS, OA>
) -> Option<Owner<PxScene<U, L, S, D, T, C, OC, OT, OCB, OWS, OA>>> where
L: ArticulationLink,
S: RigidStatic,
D: RigidDynamic,
T: Articulation,
C: ArticulationReducedCoordinate,
OC: CollisionCallback,
OT: TriggerCallback,
OCB: ConstraintBreakCallback,
OWS: WakeSleepCallback<L, S, D>,
OA: AdvanceCallback<L, D>,
fn create_scene<U, L, S, D, T, C, OC, OT, OCB, OWS, OA>(
&mut self,
scene_descriptor: SceneDescriptor<U, L, S, D, T, C, OC, OT, OCB, OWS, OA>
) -> Option<Owner<PxScene<U, L, S, D, T, C, OC, OT, OCB, OWS, OA>>> where
L: ArticulationLink,
S: RigidStatic,
D: RigidDynamic,
T: Articulation,
C: ArticulationReducedCoordinate,
OC: CollisionCallback,
OT: TriggerCallback,
OCB: ConstraintBreakCallback,
OWS: WakeSleepCallback<L, S, D>,
OA: AdvanceCallback<L, D>,
Create a new scene with from a descriptor.
sourcefn create_aggregate<L, S, D, T, C>(
&mut self,
max_size: u32,
self_collision: bool
) -> Option<Owner<PxAggregate<L, S, D, T, C>>> where
L: ArticulationLink,
S: RigidStatic,
D: RigidDynamic,
T: Articulation,
C: ArticulationReducedCoordinate,
fn create_aggregate<L, S, D, T, C>(
&mut self,
max_size: u32,
self_collision: bool
) -> Option<Owner<PxAggregate<L, S, D, T, C>>> where
L: ArticulationLink,
S: RigidStatic,
D: RigidDynamic,
T: Articulation,
C: ArticulationReducedCoordinate,
Create a new aggregate. Must be added to a scene with the same actor user data types.
sourcefn create_articulation<U, L: ArticulationLink>(
&mut self,
user_data: U
) -> Option<Owner<PxArticulation<U, L>>>
fn create_articulation<U, L: ArticulationLink>(
&mut self,
user_data: U
) -> Option<Owner<PxArticulation<U, L>>>
Create a new articulation. Must be added to a scene with the same user data types.
sourcefn create_articulation_reduced_coordinate<U, L: ArticulationLink>(
&mut self,
user_data: U
) -> Option<Owner<PxArticulationReducedCoordinate<U, L>>>
fn create_articulation_reduced_coordinate<U, L: ArticulationLink>(
&mut self,
user_data: U
) -> Option<Owner<PxArticulationReducedCoordinate<U, L>>>
Create a new articulation. Must be added to a scene with the same user data types.
sourcefn create_bvh_structure(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<BvhStructure>>
fn create_bvh_structure(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<BvhStructure>>
Create a new BVH structure. The BVH structure class-trait is not implemented yet.
sourcefn create_constraint(
&mut self,
first_actor: &mut impl RigidActor,
second_actor: &mut impl RigidActor,
connector: &mut PxConstraintConnector,
shaders: &PxConstraintShaderTable,
data_size: u32
) -> Option<Owner<Constraint>>
fn create_constraint(
&mut self,
first_actor: &mut impl RigidActor,
second_actor: &mut impl RigidActor,
connector: &mut PxConstraintConnector,
shaders: &PxConstraintShaderTable,
data_size: u32
) -> Option<Owner<Constraint>>
Create a new constraint. The constraint class-trait is not implemented yet.
sourcefn create_convex_mesh(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<ConvexMesh>>
fn create_convex_mesh(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<ConvexMesh>>
Create a new convex mesh. The convex mesh class-trait is not implemented yet.
sourcefn create_height_field(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<HeightField>>
fn create_height_field(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<HeightField>>
Create a new height field.
sourcefn create_material(
&mut self,
static_friction: f32,
dynamic_friction: f32,
restitution: f32,
user_data: <<Self::Shape as Shape>::Material as UserData>::UserData
) -> Option<Owner<<Self::Shape as Shape>::Material>>
fn create_material(
&mut self,
static_friction: f32,
dynamic_friction: f32,
restitution: f32,
user_data: <<Self::Shape as Shape>::Material as UserData>::UserData
) -> Option<Owner<<Self::Shape as Shape>::Material>>
Create a new material with ref count set to one.
sourcefn create_pruning_structure(
&mut self,
actors: Vec<&mut impl RigidActor>
) -> Option<Owner<PruningStructure>>
fn create_pruning_structure(
&mut self,
actors: Vec<&mut impl RigidActor>
) -> Option<Owner<PruningStructure>>
Create a new pruning structure. The pruning structure class-trait is not implemented yet.
sourcefn create_dynamic<U>(
&mut self,
transform: &PxTransform,
user_data: U
) -> Option<Owner<PxRigidDynamic<U, Self::Shape>>>
fn create_dynamic<U>(
&mut self,
transform: &PxTransform,
user_data: U
) -> Option<Owner<PxRigidDynamic<U, Self::Shape>>>
Create a dynamic actor with given transform and user data. Other fields are initialized to their defaults. Read more
sourcefn create_static<U>(
&mut self,
transform: PxTransform,
user_data: U
) -> Option<Owner<PxRigidStatic<U, Self::Shape>>>
fn create_static<U>(
&mut self,
transform: PxTransform,
user_data: U
) -> Option<Owner<PxRigidStatic<U, Self::Shape>>>
Create a static actor with given transform and user data. Other fields are initialized to their defaults. Read more
sourcefn create_shape(
&mut self,
geometry: &impl Geometry,
materials: &mut [&mut <Self::Shape as Shape>::Material],
is_exclusive: bool,
shape_flags: ShapeFlags,
user_data: <Self::Shape as UserData>::UserData
) -> Option<Owner<Self::Shape>>
fn create_shape(
&mut self,
geometry: &impl Geometry,
materials: &mut [&mut <Self::Shape as Shape>::Material],
is_exclusive: bool,
shape_flags: ShapeFlags,
user_data: <Self::Shape as UserData>::UserData
) -> Option<Owner<Self::Shape>>
Create a new shape.
sourcefn create_triangle_mesh(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<TriangleMesh>>
fn create_triangle_mesh(
&mut self,
stream: &mut PxInputStream
) -> Option<Owner<TriangleMesh>>
Create a new pruning structure. The pruning structure class-trait is not implemented yet.
sourcefn create_rigid_dynamic<U>(
&mut self,
transform: PxTransform,
geometry: &impl Geometry,
material: &mut <Self::Shape as Shape>::Material,
density: f32,
shape_transform: PxTransform,
user_data: U
) -> Option<Owner<PxRigidDynamic<U, Self::Shape>>>
fn create_rigid_dynamic<U>(
&mut self,
transform: PxTransform,
geometry: &impl Geometry,
material: &mut <Self::Shape as Shape>::Material,
density: f32,
shape_transform: PxTransform,
user_data: U
) -> Option<Owner<PxRigidDynamic<U, Self::Shape>>>
Create a new rigid dynamic actor.
sourcefn create_rigid_static<U>(
&mut self,
transform: PxTransform,
geometry: &impl Geometry,
material: &mut <Self::Shape as Shape>::Material,
shape_transform: PxTransform,
user_data: U
) -> Option<Owner<PxRigidStatic<U, Self::Shape>>>
fn create_rigid_static<U>(
&mut self,
transform: PxTransform,
geometry: &impl Geometry,
material: &mut <Self::Shape as Shape>::Material,
shape_transform: PxTransform,
user_data: U
) -> Option<Owner<PxRigidStatic<U, Self::Shape>>>
Create a new rigid static actor.
sourcefn create_plane<U>(
&mut self,
normal: PxVec3,
offset: f32,
material: &mut <Self::Shape as Shape>::Material,
user_data: U
) -> Option<Owner<PxRigidStatic<U, Self::Shape>>>
fn create_plane<U>(
&mut self,
normal: PxVec3,
offset: f32,
material: &mut <Self::Shape as Shape>::Material,
user_data: U
) -> Option<Owner<PxRigidStatic<U, Self::Shape>>>
Create a plane, with plane equation normal
.dot(v) + offset
= 0.
sourcefn get_bvh_structures(&self) -> Vec<&BvhStructure>
fn get_bvh_structures(&self) -> Vec<&BvhStructure>
Get the BVH structures created by this physics object.
sourcefn get_convex_meshes(&self) -> Vec<&ConvexMesh>
fn get_convex_meshes(&self) -> Vec<&ConvexMesh>
Get the convex meshes created by this physics object.
sourcefn get_height_fields(&self) -> Vec<&HeightField>
fn get_height_fields(&self) -> Vec<&HeightField>
Get the height fields created by this physics object.
sourcefn get_materials(&self) -> Vec<&<Self::Shape as Shape>::Material>
fn get_materials(&self) -> Vec<&<Self::Shape as Shape>::Material>
Get the height fields created by this physics object.
sourcefn get_shapes(&self) -> Vec<&Self::Shape>
fn get_shapes(&self) -> Vec<&Self::Shape>
Get the shapes created by this physics object.
sourcefn get_triangle_meshes(&self) -> Vec<&TriangleMesh>
fn get_triangle_meshes(&self) -> Vec<&TriangleMesh>
Get the triangle mesghes created by this object.
sourcefn get_tolerances_scale(&self) -> Option<&PxTolerancesScale>
fn get_tolerances_scale(&self) -> Option<&PxTolerancesScale>
Get the tolerance scale.
sourcefn get_physics_insertion_callback(
&mut self
) -> Option<&mut PxPhysicsInsertionCallback>
fn get_physics_insertion_callback(
&mut self
) -> Option<&mut PxPhysicsInsertionCallback>
Get the physics insertion callback, used for real-time cooking of physics meshes.
impl<Geom: Shape + Send> Send for PxPhysics<Geom>
impl<Geom: Shape + Sync> Sync for PxPhysics<Geom>
Auto Trait Implementations
impl<Geom> RefUnwindSafe for PxPhysics<Geom> where
Geom: RefUnwindSafe,
impl<Geom> Unpin for PxPhysics<Geom> where
Geom: Unpin,
impl<Geom> UnwindSafe for PxPhysics<Geom> where
Geom: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more