Extensions
Classes
PxAnisotropyCallback: Default implementation of a particle system callback to trigger anisotropy calculations.
PxAnisotropyGenerator: Computes anisotropy information for a particle system to improve rendering quality.
PxBinaryConverter: Binary converter for serialized streams.
PxCustomGeometryExt: Pre-made custom geometry callbacks implementations.
PxCustomSceneQuerySystem: A custom scene query system.
PxCustomSceneQuerySystemAdapter: An adapter class to customize the object-to-pruner mapping.
PxD6Joint: A D6 joint is a general constraint between two actors.
PxD6JointDrive: parameters for configuring the drive model of a PxD6Joint
PxDefaultAllocator: default implementation of the allocator interface required by the SDK
PxDefaultCpuDispatcher: A default implementation for a CPU task dispatcher.
PxDefaultErrorCallback: default implementation of the error callback
PxDefaultFileInputData: default implementation of a file read stream
PxDefaultFileOutputStream: default implementation of a file write stream
PxDefaultMemoryInputData: default implementation of a memory read stream
PxDefaultMemoryOutputStream: default implementation of a memory write stream
PxDistanceJoint: a joint that maintains an upper or lower bound (or both) on the distance between two points on different objects
PxFixedJoint: A fixed joint permits no relative movement between two bodies.
PxGearJoint: A joint that connects two existing revolute joints and constrains their relative angular velocity and position with respect to each other.
PxGroupsMask: 64-bit mask used for collision filtering.
PxIsosurfaceCallback: Default implementation of a particle system callback to trigger the isosurface extraction.
PxIsosurfaceExtractor: Base class for isosurface extractors.
PxJoint: a base interface providing common functionality for PhysX joints
PxJointLimitCone: Describes an elliptical conical joint limit.
PxJointLimitParameters: Describes the parameters for a joint limit.
PxJointLimitPyramid: Describes a pyramidal joint limit.
PxJointLinearLimit: Describes a one-sided linear limit.
PxJointLinearLimitPair: Describes a two-sided limit.
PxMassProperties: Utility class to compute and manipulate mass and inertia tensor properties.
PxMeshOverlapUtil: Utility class to find mesh triangles touched by a specified geometry object.
PxParticleNeighborhoodProvider: Computes neighborhood information for a point cloud.
PxPoissonSampler: Sampler to generate Poisson Samples locally on a triangle mesh or a shape.
PxPrismaticJoint: A prismatic joint permits relative translational movement between two bodies along an axis, but no relative rotational movement.
PxRackAndPinionJoint: A joint that connects an existing revolute joint to an existing prismatic joint, and constrains their relative angular/linear velocity and position with respect to each other.
PxRemeshingExt: Provides methods to adjust the tessellation of meshes.
PxRevoluteJoint: A joint which behaves in a similar way to a hinge or axle.
PxRigidActorExt: utility functions for use with PxRigidActor and subclasses
PxRigidBodyExt: utility functions for use with PxRigidBody and subclasses
PxSamplingExt: utility functions to sample vertices on or inside a triangle mesh or other geometries
PxSceneQueryExt: utility functions for use with PxScene , related to scene queries.
PxSerialization: Utility functions for serialization.
PxSerializer: Serialization interface class.
PxSerializerDefaultAdapter: Default PxSerializer implementation.
PxShapeExt: utility functions for use with PxShape
PxSmoothedPositionCallback: Default implementation of a particle system callback to trigger smoothed position calculations.
PxSmoothedPositionGenerator: Ccomputes smoothed positions for a particle system to improve rendering quality.
PxSoftBodyExt: Utility functions for use with PxSoftBody and subclasses.
PxSparseGridIsosurfaceExtractor: Base class for sparse grid based isosurface extractors.
PxSphericalJoint: A joint which behaves in a similar way to a ball and socket.
PxTetMaker: Provides functionality to create a tetrahedral mesh from a triangle mesh.
PxTetrahedronMeshExt: utility functions for use with PxTetrahedronMesh and subclasses
PxTriangleMeshPoissonSampler: Sampler to generate Poisson Samples on a triangle mesh.
RaycastCCDManager: Raycast-CCD manager.
Macros
PX_BINARY_SERIAL_VERSION: PX_BINARY_SERIAL_VERSION is used to version the PhysX binary data and meta data.
PX_DELETE_SERIALIZER_ADAPTER: Preprocessor Macro to simplify adapter deletion.
PX_NEW_SERIALIZER_ADAPTER: Preprocessor Macro to simplify adapter creation.
Functions
PxBuildSmoothNormals(physx::PxU32 nbTris, physx::PxU32 nbVerts, const physx::PxVec3 *verts, const physx::PxU32 *dFaces, const physx::PxU16 *wFaces, physx::PxVec3 *normals, bool flip): Builds smooth vertex normals over a mesh.
PxCloneDynamic(PxPhysics &physicsSDK, const PxTransform &transform, const PxRigidDynamic &body): create a dynamic body by copying attributes from an existing body
PxCloneShape(PxPhysics &physicsSDK, const PxShape &shape, bool isExclusive): create a shape by copying attributes from another shape
PxCloneStatic(PxPhysics &physicsSDK, const PxTransform &transform, const PxRigidActor &actor): create a static body by copying attributes from another rigid actor
PxCloseExtensions(): Shut down the PhysXExtensions library.
PxComputeHeightFieldPenetration(PxVec3 &direction, PxReal &depth, const PxGeometry &geom, const PxTransform &geomPose, const PxHeightFieldGeometry &heightFieldGeom, const PxTransform &heightFieldPose, PxU32 maxIter, PxU32 *usedIter=NULL): Computes an approximate minimum translational distance (MTD) between a geometry object and a heightfield.
PxComputeTriangleMeshPenetration(PxVec3 &direction, PxReal &depth, const PxGeometry &geom, const PxTransform &geomPose, const PxTriangleMeshGeometry &meshGeom, const PxTransform &meshPose, PxU32 maxIter, PxU32 *usedIter=NULL): Computes an approximate minimum translational distance (MTD) between a geometry object and a mesh.
PxCreateBatchQueryExt(const PxScene &scene, PxQueryFilterCallback *queryFilterCallback, PxRaycastBuffer *raycastBuffers, const PxU32 maxNbRaycasts, PxRaycastHit *raycastTouches, const PxU32 maxNbRaycastTouches, PxSweepBuffer *sweepBuffers, const PxU32 maxNbSweeps, PxSweepHit *sweepTouches, const PxU32 maxNbSweepTouches, PxOverlapBuffer *overlapBuffers, const PxU32 maxNbOverlaps, PxOverlapHit *overlapTouches, const PxU32 maxNbOverlapTouches): Create a PxBatchQueryExt with user-supplied result and touch buffers.
PxCreateBatchQueryExt(const PxScene &scene, PxQueryFilterCallback *queryFilterCallback, const PxU32 maxNbRaycasts, const PxU32 maxNbRaycastTouches, const PxU32 maxNbSweeps, const PxU32 maxNbSweepTouches, const PxU32 maxNbOverlaps, const PxU32 maxNbOverlapTouches): Create a PxBatchQueryExt without the need for pre-allocated result or touch buffers.
PxCreateCustomSceneQuerySystem(PxSceneQueryUpdateMode::Enum sceneQueryUpdateMode, PxU64 contextID, const PxCustomSceneQuerySystemAdapter &adapter, bool usesTreeOfPruners=false): Creates a custom scene query system.
PxCreateDynamic(PxPhysics &sdk, const PxTransform &transform, const PxGeometry &geometry, PxMaterial &material, PxReal density, const PxTransform &shapeOffset=PxTransform(PxIdentity)): simple method to create a PxRigidDynamic actor with a single PxShape .
PxCreateDynamic(PxPhysics &sdk, const PxTransform &transform, PxShape &shape, PxReal density): simple method to create a PxRigidDynamic actor with a single PxShape .
PxCreateExternalSceneQuerySystem(const PxSceneQueryDesc &desc, PxU64 contextID): Creates an external scene query system.
PxCreateKinematic(PxPhysics &sdk, const PxTransform &transform, PxShape &shape, PxReal density): simple method to create a kinematic PxRigidDynamic actor with a single PxShape .
PxCreateKinematic(PxPhysics &sdk, const PxTransform &transform, const PxGeometry &geometry, PxMaterial &material, PxReal density, const PxTransform &shapeOffset=PxTransform(PxIdentity)): simple method to create a kinematic PxRigidDynamic actor with a single PxShape .
PxCreateParticleClothCooker(PxU32 vertexCount, physx::PxVec4 *inVertices, PxU32 triangleIndexCount, PxU32 *inTriangleIndices, PxU32 constraintTypeFlags=ExtGpu::PxParticleClothConstraint::eTYPE_ALL, PxVec3 verticalDirection=PxVec3(0.0f, 1.0f, 0.0f), PxReal bendingConstraintMaxAngle=20.0f *PxTwoPi/360.0f): Creates a PxParticleClothCooker.
PxCreatePlane(PxPhysics &sdk, const PxPlane &plane, PxMaterial &material): create a plane actor.
PxCreateShapeSampler(const PxGeometry &geometry, const PxTransform &transform, const PxBounds3 &worldBounds, PxReal initialSamplingRadius, PxI32 numSampleAttemptsAroundPoint=30): Creates a shape sampler.
PxCreateStatic(PxPhysics &sdk, const PxTransform &transform, PxShape &shape): simple method to create a PxRigidStatic actor with a single PxShape .
PxCreateStatic(PxPhysics &sdk, const PxTransform &transform, const PxGeometry &geometry, PxMaterial &material, const PxTransform &shapeOffset=PxTransform(PxIdentity)): simple method to create a PxRigidStatic actor with a single PxShape .
PxCreateTriangleMeshSampler(const PxU32 *triangles, PxU32 numTriangles, const PxVec3 *vertices, PxU32 numVertices, PxReal initialSamplingRadius, PxI32 numSampleAttemptsAroundPoint=30): Creates a triangle mesh sampler.
PxD6JointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a D6 joint.
PxD6JointCreate_Distance(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, float maxDist, bool useD6): Helper function to create a distance joint, using either a PxD6Joint or PxDistanceJoint .
PxD6JointCreate_Fixed(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, bool useD6): Helper function to create a fixed joint, using either a PxD6Joint or PxFixedJoint .
PxD6JointCreate_GenericCone(float &apiroty, float &apirotz, PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, float minLimit1, float maxLimit1, float minLimit2, float maxLimit2, bool useD6): Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint .
PxD6JointCreate_Prismatic(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit, float maxLimit, bool useD6): Helper function to create a prismatic joint, using either a PxD6Joint or PxPrismaticJoint .
PxD6JointCreate_Pyramid(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit1, float maxLimit1, float minLimit2, float maxLimit2): Helper function to create a D6 joint with pyramidal swing limits.
PxD6JointCreate_Revolute(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit, float maxLimit, bool useD6): Helper function to create a revolute joint, using either a PxD6Joint or PxRevoluteJoint .
PxD6JointCreate_Spherical(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float limit1, float limit2, bool useD6): Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint .
PxDefaultCpuDispatcherCreate(PxU32 numThreads, PxU32 *affinityMasks=NULL, PxDefaultCpuDispatcherWaitForWorkMode::Enum mode=PxDefaultCpuDispatcherWaitForWorkMode::eWAIT_FOR_WORK, PxU32 yieldProcessorCount=0): Create default dispatcher, extensions SDK needs to be initialized first.
PxDefaultSimulationFilterShader(PxFilterObjectAttributes attributes0, PxFilterData filterData0, PxFilterObjectAttributes attributes1, PxFilterData filterData1, PxPairFlags &pairFlags, const void *constantBlock, PxU32 constantBlockSize): Implementation of a simple filter shader that emulates PhysX 2.8.x filtering.
PxDistanceJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a distance Joint.
PxExtractIsosurfaceFromSDF(const PxTriangleMesh &triangleMesh, PxArray< PxVec3 > &isosurfaceVertices, PxArray< PxU32 > &isosurfaceTriangleIndices): Extracts an isosurface from the SDF of a mesh if it the SDF is available.
PxFindFaceIndex(const PxConvexMeshGeometry &convexGeom, const PxTransform &geomPose, const PxVec3 &impactPos, const PxVec3 &unitDir): Computes closest polygon of the convex hull geometry for a given impact point and impact direction.
PxFixedJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a fixed joint.
PxGearJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a gear Joint.
PxGetFilterBool(): Retrieves filtering's boolean value.
PxGetFilterConstants(PxGroupsMask &c0, PxGroupsMask &c1): Gets filtering constant K0 and K1.
PxGetFilterOps(PxFilterOp::Enum &op0, PxFilterOp::Enum &op1, PxFilterOp::Enum &op2): Retrieves filtering operation.
PxGetGroup(const PxActor &actor): Retrieves the value set with PxSetGroup()
PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2): Determines if collision detection is performed between a pair of groups.
PxGetGroupsMask(const PxActor &actor): Gets 64-bit mask used for collision filtering.
PxInitExtensions(physx::PxPhysics &physics, physx::PxPvd *pvd): Initialize the PhysXExtensions library.
PxPrismaticJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a prismatic joint.
PxRackAndPinionJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a rack & pinion Joint.
PxRevoluteJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a revolute joint.
PxScaleRigidActor(PxRigidActor &actor, PxReal scale, bool scaleMassProps=true): scale a rigid actor by a uniform scale
PxSetFilterBool(const bool enable): Setups filtering's boolean value.
PxSetFilterConstants(const PxGroupsMask &c0, const PxGroupsMask &c1): Setups filtering's K0 and K1 value.
PxSetFilterOps(const PxFilterOp::Enum &op0, const PxFilterOp::Enum &op1, const PxFilterOp::Enum &op2): Setups filtering operations.
PxSetGroup(PxActor &actor, const PxU16 collisionGroup): Sets which collision group this actor is part of.
PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable): Specifies if collision should be performed by a pair of groups.
PxSetGroupsMask(PxActor &actor, const PxGroupsMask &mask): Sets 64-bit mask used for collision filtering.
PxSetJointGlobalFrame(physx::PxJoint &joint, const physx::PxVec3 *wsAnchor, const physx::PxVec3 *wsAxis): Helper function to setup a joint's global frame.
PxSphericalJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1): Create a spherical joint.
Namespaces
Structs
PxConstraintExtIDs: Unique identifiers for extensions classes which implement a constraint based on PxConstraint .
PxD6Axis: Used to specify one of the degrees of freedom of a D6 joint.
PxD6Drive: Used to specify which axes of a D6 joint are driven.
PxD6JointDriveFlag: flags for configuring the drive model of a PxD6Joint
PxD6Motion: Used to specify the range of motions allowed for a degree of freedom in a D6 joint.
PxDefaultCpuDispatcherWaitForWorkMode: If a thread ends up waiting for work it will find itself in a spin-wait loop until work becomes available.
PxDistanceJointFlag: flags for configuring the drive of a PxDistanceJoint
PxFilterOp: Collision filtering operations.
PxIsosurfaceGridFilteringType: Identifies filter type to be applied on the isosurface grid.
PxIsosurfaceParams: Parameters to define the isosurface extraction settings like isosurface level, filtering etc.
PxJointActorIndex: an enumeration for specifying one or other of the actors referenced by a joint
PxJointConcreteType: an enumeration of PhysX' built-in joint types
PxPrismaticJointFlag: Flags specific to the prismatic joint.
PxRepXInstantiationArgs: Arguments required to instantiate a serializable object from RepX.
PxRepXObject: Helper class containing the mapping of id to object, and type name.
PxRevoluteJointFlag: Flags specific to the Revolute Joint.
PxSphericalJointFlag: Flags specific to the spherical joint.
Typedefs
Functions
-
bool PxBuildSmoothNormals(physx::PxU32 nbTris, physx::PxU32 nbVerts, const physx::PxVec3 *verts, const physx::PxU32 *dFaces, const physx::PxU16 *wFaces, physx::PxVec3 *normals, bool flip)
Builds smooth vertex normals over a mesh.
“smooth” because smoothing groups are not supported here
takes angles into account for correct cube normals computation
To use 32bit indices pass a pointer in dFaces and set wFaces to zero. Alternatively pass a pointer to wFaces and set dFaces to zero.
- Parameters
nbTris – [in] Number of triangles
nbVerts – [in] Number of vertices
verts – [in] Array of vertices
dFaces – [in] Array of dword triangle indices, or null
wFaces – [in] Array of word triangle indices, or null
normals – [out] Array of computed normals (assumes nbVerts vectors)
flip – [in] Flips the normals or not
- Returns
True on success.
-
PxRigidDynamic *PxCloneDynamic(PxPhysics &physicsSDK, const PxTransform &transform, const PxRigidDynamic &body)
create a dynamic body by copying attributes from an existing body
The following properties are copied:
shapes
actor flags, rigidDynamic flags and rigidDynamic lock flags
mass, moment of inertia, and center of mass frame
linear and angular velocity
linear and angular damping
maximum linear velocity
maximum angular velocity
position and velocity solver iterations
maximum depenetration velocity
sleep threshold
contact report threshold
dominance group
owner client and client behavior bits
name pointer
kinematic target
The following are not copied and retain their default values:
name
joints or observers
aggregate or scene membership
sleep timer
user data
Note
Transforms are not copied with bit-exact accuracy.
- Parameters
physicsSDK – [in] PxPhysics - the physics SDK used to allocate the rigid static
body – [in] the rigid dynamic to clone.
transform – [in] the transform of the new dynamic
- Returns
the newly-created rigid static
-
PxShape *PxCloneShape(PxPhysics &physicsSDK, const PxShape &shape, bool isExclusive)
create a shape by copying attributes from another shape
The function clones a PxShape. The following properties are copied:
geometry
flags
materials
actor-local pose
contact offset
rest offset
simulation filter data
query filter data
torsional patch radius
minimum torsional patch radius
The following are not copied and retain their default values:
name
user data
- Parameters
physicsSDK – [in] - the physics SDK used to allocate the shape
shape – [in] the shape from which to take the attributes.
isExclusive – [in] whether the new shape should be an exclusive or shared shape.
- Returns
the newly-created rigid static
-
PxRigidStatic *PxCloneStatic(PxPhysics &physicsSDK, const PxTransform &transform, const PxRigidActor &actor)
create a static body by copying attributes from another rigid actor
The function clones a PxRigidDynamic or PxRigidStatic as a PxRigidStatic. A uniform scale is applied. The following properties are copied:
shapes
actor flags
owner client and client behavior bits
dominance group
The following are not copied and retain their default values:
name
joints or observers
aggregate or scene membership
user data
Note
Transforms are not copied with bit-exact accuracy.
- Parameters
physicsSDK – [in] - the physics SDK used to allocate the rigid static
actor – [in] the rigid actor from which to take the attributes.
transform – [in] the transform of the new static.
- Returns
the newly-created rigid static
-
void PxCloseExtensions()
Shut down the PhysXExtensions library.
This function should be called to cleanly shut down the PhysXExtensions library before application exit.
See also
Note
This function is required to be called to release foundation usage.
-
bool PxComputeHeightFieldPenetration(PxVec3 &direction, PxReal &depth, const PxGeometry &geom, const PxTransform &geomPose, const PxHeightFieldGeometry &heightFieldGeom, const PxTransform &heightFieldPose, PxU32 maxIter, PxU32 *usedIter = NULL)
Computes an approximate minimum translational distance (MTD) between a geometry object and a heightfield.
This iterative function computes an approximate vector that can be used to depenetrate a geom object from a heightfield. Returned depenetration vector should be applied to ‘geom’, to get out of the heightfield.
The function works best when the amount of overlap between the geom object and the mesh is small. If the geom object’s center goes inside the heightfield, backface culling usually kicks in, no overlap is detected, and the function does not compute an MTD vector.
The function early exits if no overlap is detected after a depenetration attempt. This means that if maxIter = N, the code will attempt at most N iterations but it might exit earlier if depenetration has been successful. Usually N = 4 gives good results.
See also
PxGeometry PxTransform PxHeightFieldGeometry
- Parameters
direction – [out] Computed MTD unit direction
depth – [out] Penetration depth. Always positive or zero.
geom – [in] The geometry object
geomPose – [in] Pose for the geometry object
heightFieldGeom – [in] The heightfield geometry
heightFieldPose – [in] Pose for the heightfield
maxIter – [in] Max number of iterations before returning.
usedIter – [out] Number of depenetrations attempts performed during the call. Will not be returned if the pointer is NULL.
- Returns
True if the MTD has successfully been computed, i.e. if objects do overlap.
-
bool PxComputeTriangleMeshPenetration(PxVec3 &direction, PxReal &depth, const PxGeometry &geom, const PxTransform &geomPose, const PxTriangleMeshGeometry &meshGeom, const PxTransform &meshPose, PxU32 maxIter, PxU32 *usedIter = NULL)
Computes an approximate minimum translational distance (MTD) between a geometry object and a mesh.
This iterative function computes an approximate vector that can be used to depenetrate a geom object from a triangle mesh. Returned depenetration vector should be applied to ‘geom’, to get out of the mesh.
The function works best when the amount of overlap between the geom object and the mesh is small. If the geom object’s center goes inside the mesh, backface culling usually kicks in, no overlap is detected, and the function does not compute an MTD vector.
The function early exits if no overlap is detected after a depenetration attempt. This means that if maxIter = N, the code will attempt at most N iterations but it might exit earlier if depenetration has been successful. Usually N = 4 gives good results.
See also
PxGeometry PxTransform PxTriangleMeshGeometry
- Parameters
direction – [out] Computed MTD unit direction
depth – [out] Penetration depth. Always positive or zero.
geom – [in] The geometry object
geomPose – [in] Pose for the geometry object
meshGeom – [in] The mesh geometry
meshPose – [in] Pose for the mesh
maxIter – [in] Max number of iterations before returning.
usedIter – [out] Number of depenetrations attempts performed during the call. Will not be returned if the pointer is NULL.
- Returns
True if the MTD has successfully been computed, i.e. if objects do overlap.
-
PxBatchQueryExt *PxCreateBatchQueryExt(const PxScene &scene, PxQueryFilterCallback *queryFilterCallback, PxRaycastBuffer *raycastBuffers, const PxU32 maxNbRaycasts, PxRaycastHit *raycastTouches, const PxU32 maxNbRaycastTouches, PxSweepBuffer *sweepBuffers, const PxU32 maxNbSweeps, PxSweepHit *sweepTouches, const PxU32 maxNbSweepTouches, PxOverlapBuffer *overlapBuffers, const PxU32 maxNbOverlaps, PxOverlapHit *overlapTouches, const PxU32 maxNbOverlapTouches)
Create a PxBatchQueryExt with user-supplied result and touch buffers.
- Parameters
scene – [in] Queries will be performed against objects in the specified PxScene
queryFilterCallback – [in] Filtering for all queries is performed using queryFilterCallback. A null pointer results in all shapes being considered.
raycastBuffers – [in] This is the array that will be used to store the results of each raycast in a batch.
maxNbRaycasts – [in] This is the length of the raycastBuffers array.
raycastTouches – [in] This is the array that will be used to store the touches generated by all raycasts in a batch.
maxNbRaycastTouches – [in] This is the length of the raycastTouches array.
sweepBuffers – [in] This is the array that will be used to store the results of each sweep in a batch.
maxNbSweeps – [in] This is the length of the sweepBuffers array.
sweepTouches – [in] This is the array that will be used to store the touches generated by all sweeps in a batch.
maxNbSweepTouches – [in] This is the length of the sweepTouches array.
overlapBuffers – [in] This is the array that will be used to store the results of each overlap in a batch.
maxNbOverlaps – [in] This is the length of the overlapBuffers array.
overlapTouches – [in] This is the array that will be used to store the touches generated by all overlaps in a batch.
maxNbOverlapTouches – [in] This is the length of the overlapTouches array.
- Returns
Returns a PxBatchQueryExt instance. A NULL pointer will be returned if the subsequent allocations fail or if any of the arguments are illegal. In the event that a NULL pointer is returned a corresponding error will be issued to the error stream.
-
PxBatchQueryExt *PxCreateBatchQueryExt(const PxScene &scene, PxQueryFilterCallback *queryFilterCallback, const PxU32 maxNbRaycasts, const PxU32 maxNbRaycastTouches, const PxU32 maxNbSweeps, const PxU32 maxNbSweepTouches, const PxU32 maxNbOverlaps, const PxU32 maxNbOverlapTouches)
Create a PxBatchQueryExt without the need for pre-allocated result or touch buffers.
- Parameters
scene – [in] Queries will be performed against objects in the specified PxScene
queryFilterCallback – [in] Filtering for all queries is performed using queryFilterCallback. A null pointer results in all shapes being considered.
maxNbRaycasts – [in] A result buffer will be allocated that is large enough to accommodate maxNbRaycasts calls to PxBatchQueryExt::raycast()
maxNbRaycastTouches – [in] A touch buffer will be allocated that is large enough to accommodate maxNbRaycastTouches touches for all raycasts in the batch.
maxNbSweeps – [in] A result buffer will be allocated that is large enough to accommodate maxNbSweeps calls to PxBatchQueryExt::sweep()
maxNbSweepTouches – [in] A touch buffer will be allocated that is large enough to accommodate maxNbSweepTouches touches for all sweeps in the batch.
maxNbOverlaps – [in] A result buffer will be allocated that is large enough to accommodate maxNbOverlaps calls to PxBatchQueryExt::overlap()
maxNbOverlapTouches – [in] A touch buffer will be allocated that is large enough to accommodate maxNbOverlapTouches touches for all overlaps in the batch.
- Returns
Returns a PxBatchQueryExt
instance. A NULL pointer will be returned if the subsequent allocations fail or if any of the arguments are illegal.
In the event that a NULL pointer is returned a corresponding error will be issued to the error stream.
-
PxCustomSceneQuerySystem *PxCreateCustomSceneQuerySystem(PxSceneQueryUpdateMode::Enum sceneQueryUpdateMode, PxU64 contextID, const PxCustomSceneQuerySystemAdapter &adapter, bool usesTreeOfPruners = false)
Creates a custom scene query system.
This is similar to PxCreateExternalSceneQuerySystem, except this function creates a PxCustomSceneQuerySystem object. It can be plugged to PxScene the same way, via PxSceneDesc::sceneQuerySystem.
See also
PxCustomSceneQuerySystem PxSceneQueryUpdateMode PxCustomSceneQuerySystemAdapter PxSceneDesc::sceneQuerySystem
- Parameters
sceneQueryUpdateMode – [in] Desired update mode
contextID – [in] Context ID parameter, sent to the profiler
adapter – [in] Adapter class implementing our extended API
usesTreeOfPruners – [in] True to keep pruners themselves in a BVH, which might increase query performance if a lot of pruners are involved
- Returns
A custom SQ system instance
-
PxRigidDynamic *PxCreateDynamic(PxPhysics &sdk, const PxTransform &transform, const PxGeometry &geometry, PxMaterial &material, PxReal density, const PxTransform &shapeOffset = PxTransform(PxIdentity))
simple method to create a PxRigidDynamic actor with a single PxShape.
See also
- Parameters
sdk – [in] the PxPhysics object
transform – [in] the global pose of the new object
geometry – [in] the geometry of the new object’s shape, which must be a sphere, capsule, box or convex
material – [in] the material for the new object’s shape
density – [in] the density of the new object. Must be greater than zero.
shapeOffset – [in] an optional offset for the new shape, defaults to identity
- Returns
a new dynamic actor with the PxRigidBodyFlag, or NULL if it could not be constructed
-
PxRigidDynamic *PxCreateDynamic(PxPhysics &sdk, const PxTransform &transform, PxShape &shape, PxReal density)
simple method to create a PxRigidDynamic actor with a single PxShape.
See also
- Parameters
sdk – [in] the PxPhysics object
transform – [in] the transform of the new object
shape – [in] the shape of the new object
density – [in] the density of the new object. Must be greater than zero.
- Returns
a new dynamic actor with the PxRigidBodyFlag, or NULL if it could not be constructed
-
PxSceneQuerySystem *PxCreateExternalSceneQuerySystem(const PxSceneQueryDesc &desc, PxU64 contextID)
Creates an external scene query system.
An external SQ system is the part of a PxScene that deals with scene queries (SQ). This is usually taken care of by an internal implementation inside PxScene, but it is also possible to re-route all SQ calls to an external implementation, potentially opening the door to some customizations in behavior and features for advanced users.
The following external SQ system is an example of how an implementation would look like. It re-uses much of the same code as the internal version, but it could be re-implemented in a completely different way to match users’ specific needs.
See also
- Parameters
desc – [in] Scene query descriptor
contextID – [in] Context ID parameter, sent to the profiler
- Returns
An external SQ system instance
-
PxRigidDynamic *PxCreateKinematic(PxPhysics &sdk, const PxTransform &transform, PxShape &shape, PxReal density)
simple method to create a kinematic PxRigidDynamic actor with a single PxShape.
See also
Note
unlike PxCreateDynamic, the geometry is not restricted to box, capsule, sphere or convex. However, kinematics of other geometry types may not participate in simulation collision and may be used only for triggers or scene queries of moving objects under animation control. In this case the density parameter will be ignored and the created shape will be set up as a scene query only shape (see PxShapeFlag::eSCENE_QUERY_SHAPE)
- Parameters
sdk – [in] the PxPhysics object
transform – [in] the global pose of the new object
density – [in] the density of the new object. Must be greater than zero if the object is to participate in simulation.
shape – [in] the shape of the new object
- Returns
a new dynamic actor with the PxRigidBodyFlag::eKINEMATIC set, or NULL if it could not be constructed
-
PxRigidDynamic *PxCreateKinematic(PxPhysics &sdk, const PxTransform &transform, const PxGeometry &geometry, PxMaterial &material, PxReal density, const PxTransform &shapeOffset = PxTransform(PxIdentity))
simple method to create a kinematic PxRigidDynamic actor with a single PxShape.
See also
Note
unlike PxCreateDynamic, the geometry is not restricted to box, capsule, sphere or convex. However, kinematics of other geometry types may not participate in simulation collision and may be used only for triggers or scene queries of moving objects under animation control. In this case the density parameter will be ignored and the created shape will be set up as a scene query only shape (see PxShapeFlag::eSCENE_QUERY_SHAPE)
- Parameters
sdk – [in] the PxPhysics object
transform – [in] the global pose of the new object
geometry – [in] the geometry of the new object’s shape
material – [in] the material for the new object’s shape
density – [in] the density of the new object. Must be greater than zero if the object is to participate in simulation.
shapeOffset – [in] an optional offset for the new shape, defaults to identity
- Returns
a new dynamic actor with the PxRigidBodyFlag::eKINEMATIC set, or NULL if it could not be constructed
-
ExtGpu::PxParticleClothCooker *PxCreateParticleClothCooker(PxU32 vertexCount, physx::PxVec4 *inVertices, PxU32 triangleIndexCount, PxU32 *inTriangleIndices, PxU32 constraintTypeFlags = ExtGpu::PxParticleClothConstraint::eTYPE_ALL, PxVec3 verticalDirection = PxVec3(0.0f, 1.0f, 0.0f), PxReal bendingConstraintMaxAngle = 20.0f * PxTwoPi / 360.0f)
Creates a PxParticleClothCooker.
- Parameters
vertexCount – [in] The number of vertices of the particle cloth.
inVertices – [in] The vertex positions of the particle cloth.
triangleIndexCount – [in] The number of triangles of the cloth mesh.
inTriangleIndices – [in] The triangle indices of the cloth mesh
constraintTypeFlags – [in] The types of constraints to generate. See PxParticleClothConstraint.
verticalDirection – [in] The vertical direction of the cloth mesh. This is needed to generate the correct horizontal and vertical constraints to model shear stiffness.
bendingConstraintMaxAngle – [in] The maximum angle (in radians) considered in the bending constraints.
- Returns
A pointer to the new PxParticleClothCooker.
-
PxRigidStatic *PxCreatePlane(PxPhysics &sdk, const PxPlane &plane, PxMaterial &material)
create a plane actor.
The plane equation is n.x + d = 0
See also
- Parameters
sdk – [in] the PxPhysics object
plane – [in] a plane of the form n.x + d = 0
material – [in] the material for the new object’s shape
- Returns
a new static actor, or NULL if it could not be constructed
-
PxPoissonSampler *PxCreateShapeSampler(const PxGeometry &geometry, const PxTransform &transform, const PxBounds3 &worldBounds, PxReal initialSamplingRadius, PxI32 numSampleAttemptsAroundPoint = 30)
Creates a shape sampler.
- Parameters
geometry – [in] The shape that defines the surface on which the samples get created
transform – [in] The shape’s global pose
worldBounds – [in] The shapes bounding box
initialSamplingRadius – [in] The closest distance two surface samples are allowed to have
numSampleAttemptsAroundPoint – [in] Number of repetitions the underlying algorithm performs to find a new valid sample that matches all criteria like minimal distance to existing samples etc.
- Returns
Returns the sampler
-
PxRigidStatic *PxCreateStatic(PxPhysics &sdk, const PxTransform &transform, PxShape &shape)
simple method to create a PxRigidStatic actor with a single PxShape.
See also
- Parameters
sdk – [in] the PxPhysics object
transform – [in] the global pose of the new object
shape – [in] the new object’s shape
- Returns
a new static actor, or NULL if it could not be constructed
-
PxRigidStatic *PxCreateStatic(PxPhysics &sdk, const PxTransform &transform, const PxGeometry &geometry, PxMaterial &material, const PxTransform &shapeOffset = PxTransform(PxIdentity))
simple method to create a PxRigidStatic actor with a single PxShape.
See also
- Parameters
sdk – [in] the PxPhysics object
transform – [in] the global pose of the new object
geometry – [in] the geometry of the new object’s shape
material – [in] the material for the new object’s shape
shapeOffset – [in] an optional offset for the new shape, defaults to identity
- Returns
a new static actor, or NULL if it could not be constructed
-
PxTriangleMeshPoissonSampler *PxCreateTriangleMeshSampler(const PxU32 *triangles, PxU32 numTriangles, const PxVec3 *vertices, PxU32 numVertices, PxReal initialSamplingRadius, PxI32 numSampleAttemptsAroundPoint = 30)
Creates a triangle mesh sampler.
- Parameters
triangles – [in] The triangle indices of the mesh
numTriangles – [in] The total number of triangles
vertices – [in] The vertices of the mesh
numVertices – [in] The total number of vertices
initialSamplingRadius – [in] The closest distance two surface samples are allowed to have
numSampleAttemptsAroundPoint – [in] Number of repetitions the underlying algorithm performs to find a new valid sample that matches all criteria like minimal distance to existing samples etc.
- Returns
Returns the sampler
-
PxD6Joint *PxD6JointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a D6 joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
PxJoint *PxD6JointCreate_Distance(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, float maxDist, bool useD6)
Helper function to create a distance joint, using either a PxD6Joint or PxDistanceJoint.
This helper function only supports a maximum distance constraint, because PxD6Joint does not support a minimum distance constraint (contrary to PxDistanceJoint).
The distance is computed between the joint frames’ world-space positions. The joint frames’ orientations are irrelevant here so the function sets them to identity.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
maxDist – [in] The maximum allowed distance
useD6 – [in] True to use a PxD6Joint, false to use a PxDistanceJoint;
- Returns
The created joint.
-
PxJoint *PxD6JointCreate_Fixed(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, bool useD6)
Helper function to create a fixed joint, using either a PxD6Joint or PxFixedJoint.
For fixed joints it is important that the joint frames have the same orientation. This helper function uses an identity rotation for both. It is also important that the joint frames have an equivalent position in world space. The function does not check this, so it is up to users to ensure that this is the case.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
useD6 – [in] True to use a PxD6Joint, false to use a PxFixedJoint;
- Returns
The created joint.
-
PxJoint *PxD6JointCreate_GenericCone(float &apiroty, float &apirotz, PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, float minLimit1, float maxLimit1, float minLimit2, float maxLimit2, bool useD6)
Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint.
This function supports a cone limit shape, defined by two pairs of angular limit values. This can be used to create an asymmetric cone. If the angular limit values are symmetric (i.e. minLimit1=-maxLimit1 and minLimit2=-maxLimit2) then the cone axis is the X axis in actor0’s space. If the limits are not symmetric, the function rotates the cone axis accordingly so that limits remain symmetric for PhysX. If this happens, the initial joint frames will be different for both actors. By default minLimit1/maxLimit1 are limits around the joint’s Y axis, and minLimit2/maxLimit2 are limits around the joint’s Z axis.
The function creates hard limits, and uses PhysX’s default contact distance parameter.
Limits are expressed in radians. Allowed range is ]-PI;PI[.
The cone axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.
The returned apiroty and apirotz values can later be added to retrieved Y and Z swing angle values (from the joint), to remap angle values to the given input range.
See also
- Parameters
apiroty – [out] Amount of rotation around Y used to setup actor0’s joint frame
apirotz – [out] Amount of rotation around Z used to setup actor0’s joint frame
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
minLimit1 – [in] Min angular limit along the joint frame’s second axis (first axis = cone axis)
maxLimit1 – [in] Max angular limit along the joint frame’s second axis (first axis = cone axis)
minLimit2 – [in] Min angular limit along the joint frame’s third axis (first axis = cone axis)
maxLimit2 – [in] Max angular limit along the joint frame’s third axis (first axis = cone axis)
useD6 – [in] True to use a PxD6Joint, false to use a PxSphericalJoint;
- Returns
The created joint.
-
PxJoint *PxD6JointCreate_Prismatic(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit, float maxLimit, bool useD6)
Helper function to create a prismatic joint, using either a PxD6Joint or PxPrismaticJoint.
This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired translation axis. This orientation is computed by the function, so users only have to define the desired translation axis (typically 1;0;0 or 0;1;0 or 0;0;1).
The translation can be limited. Limits are enforced if minLimit<maxLimit. If minLimit=maxLimit the axis is locked. If minLimit>maxLimit the limits are not enforced and the axis is free. The limit values are computed relative to the position of actor0’s joint frame.
The function creates hard limits, and uses PhysX’s default contact distance parameter.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
axis – [in] The axis along which objects are allowed to move, expressed in the actors’ local space
minLimit – [in] The minimum allowed position along the axis
maxLimit – [in] The maximum allowed position along the axis
useD6 – [in] True to use a PxD6Joint, false to use a PxPrismaticJoint;
- Returns
The created joint.
-
PxJoint *PxD6JointCreate_Pyramid(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit1, float maxLimit1, float minLimit2, float maxLimit2)
Helper function to create a D6 joint with pyramidal swing limits.
This function supports a pyramid limit shape, defined by two pairs of angular limit values. This can be used to create an asymmetric pyramid. If the angular limit values are symmetric (i.e. minLimit1=-maxLimit1 and minLimit2=-maxLimit2) then the pyramid axis is the X axis in actor0’s space. By default minLimit1/maxLimit1 are limits around the joint’s Y axis, and minLimit2/maxLimit2 are limits around the joint’s Z axis.
The function creates hard limits, and uses PhysX’s default contact distance parameter.
Limits are expressed in radians. Allowed range is ]-PI;PI[.
The pyramid axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
axis – [in] The pyramid axis, expressed in the actors’ local space
minLimit1 – [in] Min angular limit along the joint frame’s second axis (first axis = pyramid axis)
maxLimit1 – [in] Max angular limit along the joint frame’s second axis (first axis = pyramid axis)
minLimit2 – [in] Min angular limit along the joint frame’s third axis (first axis = pyramid axis)
maxLimit2 – [in] Max angular limit along the joint frame’s third axis (first axis = pyramid axis)
- Returns
The created joint.
-
PxJoint *PxD6JointCreate_Revolute(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit, float maxLimit, bool useD6)
Helper function to create a revolute joint, using either a PxD6Joint or PxRevoluteJoint.
This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired rotation axis. This orientation is computed by the function, so users only have to define the desired rotation axis (typically 1;0;0 or 0;1;0 or 0;0;1).
The rotation can be limited. Limits are enforced if minLimit<maxLimit. If minLimit=maxLimit the axis is locked. If minLimit>maxLimit the limits are not enforced and the axis is free. The limit values are computed relative to the rotation of actor0’s joint frame.
The function creates hard limits, and uses PhysX’s default contact distance parameter.
Limits are expressed in radians. Allowed range is ]-2*PI;+2*PI[
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
axis – [in] The axis around which objects are allowed to move, expressed in the actors’ local space
minLimit – [in] The minimum allowed rotation along the axis
maxLimit – [in] The maximum allowed rotation along the axis
useD6 – [in] True to use a PxD6Joint, false to use a PxRevoluteJoint;
- Returns
The created joint.
-
PxJoint *PxD6JointCreate_Spherical(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float limit1, float limit2, bool useD6)
Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint.
This function supports a cone limit shape, defined by a cone axis and two angular limit values.
This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired cone axis. This orientation is computed by the function, so users only have to define the desired cone axis (typically 1;0;0 or 0;1;0 or 0;0;1).
The rotations can be limited. Limits are enforced if limit1>0 and limit2>0. Otherwise the motion is free. The limit values define an ellipse, which is the cross-section of the cone limit shape.
The function creates hard limits, and uses PhysX’s default contact distance parameter.
Limits are expressed in radians. Allowed range is ]0;PI[. Limits are symmetric around the cone axis.
The cone axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos0 – [in] The position of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localPos1 – [in] The position of the joint relative to actor1
axis – [in] The cone axis, expressed in the actors’ local space
limit1 – [in] Max angular limit for the ellipse along the joint frame’s second axis (first axis = cone axis)
limit2 – [in] Max angular limit for the ellipse along the joint frame’s third axis (first axis = cone axis)
useD6 – [in] True to use a PxD6Joint, false to use a PxSphericalJoint;
- Returns
The created joint.
-
PxDefaultCpuDispatcher *PxDefaultCpuDispatcherCreate(PxU32 numThreads, PxU32 *affinityMasks = NULL, PxDefaultCpuDispatcherWaitForWorkMode::Enum mode = PxDefaultCpuDispatcherWaitForWorkMode::eWAIT_FOR_WORK, PxU32 yieldProcessorCount = 0)
Create default dispatcher, extensions SDK needs to be initialized first.
See also
Note
numThreads may be zero in which case no worker thread are initialized and simulation tasks will be executed on the thread that calls PxScene::simulate()
Note
yieldProcessorCount must be greater than zero if eYIELD_PROCESSOR is the chosen mode and equal to zero for all other modes.
Note
eYIELD_THREAD and eYIELD_PROCESSOR modes will use compute resources even if the simulation is not running. It is left to users to keep threads inactive, if so desired, when no simulation is running.
- Parameters
numThreads – [in] Number of worker threads the dispatcher should use.
affinityMasks – [in] Array with affinity mask for each thread. If not defined, default masks will be used.
mode – [in] is the strategy employed when a busy-wait is encountered.
yieldProcessorCount – [in] specifies the number of times a OS-specific yield processor command will be executed during each cycle of a busy-wait in the event that the specified mode is eYIELD_PROCESSOR
-
PxFilterFlags PxDefaultSimulationFilterShader(PxFilterObjectAttributes attributes0, PxFilterData filterData0, PxFilterObjectAttributes attributes1, PxFilterData filterData1, PxPairFlags &pairFlags, const void *constantBlock, PxU32 constantBlockSize)
Implementation of a simple filter shader that emulates PhysX 2.8.x filtering.
This shader provides the following logic:
If one of the two filter objects is a trigger, the pair is acccepted and PxPairFlag::eTRIGGER_DEFAULT will be used for trigger reports
Else, if the filter mask logic (see further below) discards the pair it will be suppressed (PxFilterFlag::eSUPPRESS)
Else, the pair gets accepted and collision response gets enabled (PxPairFlag::eCONTACT_DEFAULT)
1) Collision groups of the pair are enabled 2) Collision filtering equation is satisfied
See also
-
PxDistanceJoint *PxDistanceJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a distance Joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
bool PxExtractIsosurfaceFromSDF(const PxTriangleMesh &triangleMesh, PxArray<PxVec3> &isosurfaceVertices, PxArray<PxU32> &isosurfaceTriangleIndices)
Extracts an isosurface from the SDF of a mesh if it the SDF is available.
- Parameters
triangleMesh – [in] The triangle mesh
isosurfaceVertices – [out] The vertices of the extracted isosurface
isosurfaceTriangleIndices – [out] The triangles of the extracted isosurface
-
PxU32 PxFindFaceIndex(const PxConvexMeshGeometry &convexGeom, const PxTransform &geomPose, const PxVec3 &impactPos, const PxVec3 &unitDir)
Computes closest polygon of the convex hull geometry for a given impact point and impact direction.
When doing sweeps against a scene, one might want to delay the rather expensive computation of the hit face index for convexes until it is clear the information is really needed and then use this method to get the corresponding face index.
See also
PxTransform PxConvexMeshGeometry
- Parameters
convexGeom – [in] The convex mesh geometry.
geomPose – [in] Pose for the geometry object.
impactPos – [in] Impact position.
unitDir – [in] Normalized impact direction.
- Returns
Closest face index of the convex geometry.
-
PxFixedJoint *PxFixedJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a fixed joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
PxGearJoint *PxGearJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a gear Joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
bool PxGetFilterBool()
Retrieves filtering’s boolean value.
See comments for PxGroupsMask
See also
- Returns
flag Boolean value for filter.
-
void PxGetFilterConstants(PxGroupsMask &c0, PxGroupsMask &c1)
Gets filtering constant K0 and K1.
See comments for PxGroupsMask
- Parameters
c0 – [out] the filtering constants, as a mask. See PxGroupsMask.
c1 – [out] the filtering constants, as a mask. See PxGroupsMask.
-
void PxGetFilterOps(PxFilterOp::Enum &op0, PxFilterOp::Enum &op1, PxFilterOp::Enum &op2)
Retrieves filtering operation.
See comments for PxGroupsMask
- Parameters
op0 – [out] First filter operator.
op1 – [out] Second filter operator.
op2 – [out] Third filter operator.
-
PxU16 PxGetGroup(const PxActor &actor)
Retrieves the value set with PxSetGroup()
See also
Note
Collision group is an integer between 0 and 31.
- Parameters
actor – [in] The actor
- Returns
The collision group this actor belongs to
-
bool PxGetGroupCollisionFlag(const PxU16 group1, const PxU16 group2)
Determines if collision detection is performed between a pair of groups.
See also
Note
Collision group is an integer between 0 and 31.
- Parameters
group1 – [in] First Group
group2 – [in] Second Group
- Returns
True if the groups could collide
-
PxGroupsMask PxGetGroupsMask(const PxActor &actor)
Gets 64-bit mask used for collision filtering.
See comments for PxGroupsMask
See also
- Parameters
actor – [in] The actor
- Returns
The group mask for the actor.
-
bool PxInitExtensions(physx::PxPhysics &physics, physx::PxPvd *pvd)
Initialize the PhysXExtensions library.
This should be called before calling any functions or methods in extensions which may require allocation.
See also
Note
This function does not need to be called before creating a PxDefaultAllocator object.
-
PxPrismaticJoint *PxPrismaticJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a prismatic joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
PxRackAndPinionJoint *PxRackAndPinionJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a rack & pinion Joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
PxRevoluteJoint *PxRevoluteJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a revolute joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
void PxScaleRigidActor(PxRigidActor &actor, PxReal scale, bool scaleMassProps = true)
scale a rigid actor by a uniform scale
The geometry and relative positions of the actor are multiplied by the given scale value. If the actor is a rigid body or an articulation link and the scaleMassProps value is true, the mass properties are scaled assuming the density is constant: the center of mass is linearly scaled, the mass is multiplied by the cube of the scale, and the inertia tensor by the fifth power of the scale.
- Parameters
actor – [in] a rigid actor
scale – [in] the scale by which to multiply the actor. Must be >0.
scaleMassProps – [in] whether to scale the mass properties
-
void PxSetFilterBool(const bool enable)
Setups filtering’s boolean value.
See comments for PxGroupsMask
See also
PxSetFilterOps PxSsetFilterConstants
- Parameters
enable – [in] Boolean value for filter.
-
void PxSetFilterConstants(const PxGroupsMask &c0, const PxGroupsMask &c1)
Setups filtering’s K0 and K1 value.
See comments for PxGroupsMask
- Parameters
c0 – [in] The new group mask. See PxGroupsMask.
c1 – [in] The new group mask. See PxGroupsMask.
-
void PxSetFilterOps(const PxFilterOp::Enum &op0, const PxFilterOp::Enum &op1, const PxFilterOp::Enum &op2)
Setups filtering operations.
See comments for PxGroupsMask
See also
- Parameters
op0 – [in] Filter op 0.
op1 – [in] Filter op 1.
op2 – [in] Filter op 2.
-
void PxSetGroup(PxActor &actor, const PxU16 collisionGroup)
Sets which collision group this actor is part of.
See also
Note
Collision group is an integer between 0 and 31.
- Parameters
actor – [in] The actor
collisionGroup – [in] Collision group this actor belongs to
-
void PxSetGroupCollisionFlag(const PxU16 group1, const PxU16 group2, const bool enable)
Specifies if collision should be performed by a pair of groups.
See also
Note
Collision group is an integer between 0 and 31.
- Parameters
group1 – [in] First Group
group2 – [in] Second Group
enable – [in] True to enable collision between the groups
-
void PxSetGroupsMask(PxActor &actor, const PxGroupsMask &mask)
Sets 64-bit mask used for collision filtering.
See comments for PxGroupsMask
See also
- Parameters
actor – [in] The actor
mask – [in] The group mask to set for the actor.
-
void PxSetJointGlobalFrame(physx::PxJoint &joint, const physx::PxVec3 *wsAnchor, const physx::PxVec3 *wsAxis)
Helper function to setup a joint’s global frame.
This replaces the following functions from previous SDK versions:
void NxJointDesc::setGlobalAnchor(const NxVec3& wsAnchor); void NxJointDesc::setGlobalAxis(const NxVec3& wsAxis);
The function sets the joint’s localPose using world-space input parameters.
- Parameters
wsAnchor – [in] Global frame anchor point. Range: position vector
wsAxis – [in] Global frame axis. Range: direction vector
joint – [inout] Joint having its global frame set.
-
PxSphericalJoint *PxSphericalJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a spherical joint.
See also
- Parameters
physics – [in] The physics SDK
actor0 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame0 – [in] The position and orientation of the joint relative to actor0
actor1 – [in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame
localFrame1 – [in] The position and orientation of the joint relative to actor1
-
inline void *platformAlignedAlloc(size_t size)
-
inline void platformAlignedFree(void *ptr)
Typedefs
-
typedef PxFlags<PxD6JointDriveFlag::Enum, PxU32> PxD6JointDriveFlags
-
typedef PxFlags<PxDistanceJointFlag::Enum, PxU16> PxDistanceJointFlags
-
typedef FILE *PxFileHandle
-
typedef PxFlags<PxPrismaticJointFlag::Enum, PxU16> PxPrismaticJointFlags
-
typedef PxFlags<PxRevoluteJointFlag::Enum, PxU16> PxRevoluteJointFlags
-
typedef PxQueryCache PxSceneQueryCache
-
typedef PxQueryFilterCallback PxSceneQueryFilterCallback
-
typedef PxQueryFilterData PxSceneQueryFilterData
-
typedef PxHitFlags PxSceneQueryFlags
-
typedef PxQueryHit PxSceneQueryHit
-
typedef PxFlags<PxSphericalJointFlag::Enum, PxU16> PxSphericalJointFlags