Common
Classes
PxBase: Base class for objects that can be members of a PxCollection .
PxCollection: Collection class for serialization.
PxDeserializationContext: Binary deserialization context class.
PxInputData: Input data class for I/O which provides random read access.
PxInputStream: Input stream class for I/O.
PxInsertionCallback: Callback interface that permits TriangleMesh, Heightfield, ConvexMesh or BVH to be used directly without the need to store the cooking results into a stream.
PxOutputStream: Output stream class for I/O.
PxProcessPxBaseCallback: Callback class used to process PxBase objects.
PxRefCounted: Base class for ref-counted objects.
PxRenderBuffer: Interface for points, lines, triangles, and text buffer.
PxSerializationContext: Binary serialization context class.
PxSerializationRegistry: Class serving as a registry for XML (RepX) and binary serializable types.
PxTolerancesScale: Class to define the scale at which simulation runs.
Macros
PX_MAKE_FOURCC: Used to fix multi-byte characters warning from gcc for situations like: PxU32 foo = 'CCTS';.
PX_SERIAL_ALIGN: Default serialization alignment.
PX_SERIAL_FILE_ALIGN: Serialized input data must be aligned to this value.
PX_SERIAL_OBJECT_ID_INVALID: PxSerialObjectId value for objects that do not have an ID.
PX_SERIAL_REF_KIND_MATERIAL_IDX: Reference kind value for material indices.
PX_SERIAL_REF_KIND_PTR_TYPE_BIT: Bit to mark pointer type references,.
PX_SERIAL_REF_KIND_PXBASE: Reference kind value for PxBase objects.
Functions
PxComputeAngle(const PxVec3 &v0, const PxVec3 &v1): Compute the angle between two non-unit vectors.
PxComputeBasisVectors(const PxVec3 &dir, PxVec3 &right, PxVec3 &up): Compute two normalized vectors (right and up) that are perpendicular to an input normalized vector (dir).
PxComputeBasisVectors(const PxVec3 &p0, const PxVec3 &p1, PxVec3 &dir, PxVec3 &right, PxVec3 &up): Compute three normalized vectors (dir, right and up) that are parallel to (dir) and perpendicular to (right, up) the normalized direction vector (p1 - p0)/||p1 - p0||.
PxCreateCollection(): Creates a collection object.
PxEllipseClamp(const PxVec3 &point, const PxVec3 &radii): Compute the closest point on an 2d ellipse to a given 2d point.
PxExp(const PxVec3 &v): Compute the exponent of a PxVec3.
PxGetNextIndex3(PxU32 i): Compute (i+1)%3.
PxIntegrateTransform(const PxTransform &curTrans, const PxVec3 &linvel, const PxVec3 &angvel, PxReal timeStep, PxTransform &result): integrate transform.
PxLargestAxis(const PxVec3 &v): return Returns 0 if v.x is largest element of v, 1 if v.y is largest element, 2 if v.z is largest element.
PxLog(const PxQuat &q): return Returns the log of a PxQuat
PxOptimizeBoundingBox(PxMat33 &basis): computes a oriented bounding box around the scaled basis.
PxPlaneEquationFromTransform(const PxTransform &pose): creates a plane equation from a transform, such as the actor transform for a PxPlaneGeometry
PxSeparateSwingTwist(const PxQuat &q, PxQuat &swing, PxQuat &twist): Compute from an input quaternion q a pair of quaternions (swing, twist) such that q = swing * twist with the caveats that swing.x = twist.y = twist.z = 0.
PxShortestRotation(const PxVec3 &from, const PxVec3 &target): finds the shortest rotation between two vectors.
PxSlerp(const PxReal t, const PxQuat &left, const PxQuat &right): Spherical linear interpolation of two quaternions.
PxTanHalf(PxReal sin, PxReal cos): Compute tan(theta/2) given sin(theta) and cos(theta) as inputs.
PxTolerancesScale::PxTolerancesScale(float defaultLength=1.0f, float defaultSpeed=10.0f): constructor sets to default
PxTolerancesScale::isValid() const: Returns true if the descriptor is valid.
PxTransformFromPlaneEquation(const PxPlane &plane): creates a transform from a plane equation, suitable for an actor transform for a PxPlaneGeometry
PxTransformFromSegment(const PxVec3 &p0, const PxVec3 &p1, PxReal *halfHeight=NULL): creates a transform from the endpoints of a segment, suitable for an actor transform for a PxCapsuleGeometry
computeBarycentric(const PxVec3 &a, const PxVec3 &b, const PxVec3 &c, const PxVec3 &p, PxVec4 &bary)
Structs
PxBaseFlag: Flags for PxBase .
PxConcreteType: an enumeration of concrete classes inheriting from PxBase
PxDebugColor: Default color values used for debug rendering.
PxDebugLine: Used to store a single line and colour for debug rendering.
PxDebugPoint: Used to store a single point and colour for debug rendering.
PxDebugText: Used to store a text for debug rendering.
PxDebugTriangle: Used to store a single triangle and colour for debug rendering.
PxTypeInfo: a structure containing per-type information for types inheriting from PxBase
Typedefs
PxBinaryMetaDataCallback: Callback type for exporting binary meta data for a serializable type.
PxSerialObjectId: ID type for PxBase objects in a PxCollection .
Functions
-
inline PxF32 PxComputeAngle(const PxVec3 &v0, const PxVec3 &v1)
Compute the angle between two non-unit vectors.
- Parameters
v0 – [in] is one of the non-unit vectors
v1 – [in] is the other of the two non-unit vectors
- Returns
Returns the angle (in radians) between the two vector v0 and v1.
-
inline void PxComputeBasisVectors(const PxVec3 &dir, PxVec3 &right, PxVec3 &up)
Compute two normalized vectors (right and up) that are perpendicular to an input normalized vector (dir).
- Parameters
dir – [in] is a normalized vector that is used to compute the perpendicular vectors.
right – [out] is the first of the two vectors perpendicular to dir
up – [out] is the second of the two vectors perpendicular to dir
-
inline void PxComputeBasisVectors(const PxVec3 &p0, const PxVec3 &p1, PxVec3 &dir, PxVec3 &right, PxVec3 &up)
Compute three normalized vectors (dir, right and up) that are parallel to (dir) and perpendicular to (right, up) the normalized direction vector (p1 - p0)/||p1 - p0||.
- Parameters
p0 – [in] is used to compute the normalized vector dir = (p1 - p0)/||p1 - p0||.
p1 – [in] is used to compute the normalized vector dir = (p1 - p0)/||p1 - p0||.
dir – [out] is the normalized vector (p1 - p0)/||p1 - p0||.
right – [out] is the first of the two normalized vectors perpendicular to dir
up – [out] is the second of the two normalized vectors perpendicular to dir
-
physx::PxCollection *PxCreateCollection()
Creates a collection object.
Objects can only be serialized or deserialized through a collection. For serialization, users must add objects to the collection and serialize the collection as a whole. For deserialization, the system gives back a collection of deserialized objects to users.
See also
- Returns
The new collection object.
-
inline PxVec3 PxEllipseClamp(const PxVec3 &point, const PxVec3 &radii)
Compute the closest point on an 2d ellipse to a given 2d point.
- Parameters
point – [in] is a 2d point in the y-z plane represented by (point.y, point.z)
radii – [in] are the radii of the ellipse (radii.y and radii.z) in the y-z plane.
- Returns
Returns the 2d position on the surface of the ellipse that is closest to point.
-
void PxIntegrateTransform(const PxTransform &curTrans, const PxVec3 &linvel, const PxVec3 &angvel, PxReal timeStep, PxTransform &result)
integrate transform.
- Parameters
curTrans – [in] The current transform
linvel – [in] Linear velocity
angvel – [in] Angular velocity
timeStep – [in] The time-step for integration
result – [out] The integrated transform
-
inline PxU32 PxLargestAxis(const PxVec3 &v)
return Returns 0 if v.x is largest element of v, 1 if v.y is largest element, 2 if v.z is largest element.
-
PxVec3 PxOptimizeBoundingBox(PxMat33 &basis)
computes a oriented bounding box around the scaled basis.
- Parameters
basis – Input = skewed basis, Output = (normalized) orthogonal basis.
- Returns
Bounding box extent.
-
inline PxPlane PxPlaneEquationFromTransform(const PxTransform &pose)
creates a plane equation from a transform, such as the actor transform for a PxPlaneGeometry
- Parameters
pose – [in] the transform
- Returns
the plane
-
inline PxReal PxSdfSample(const PxReal *sdf, const PxVec3 &localPos, const PxVec3 &sdfBoxLower, const PxVec3 &sdfBoxHigher, const PxReal sdfDx, const PxReal invSdfDx, const PxU32 dimX, const PxU32 dimY, const PxU32 dimZ, PxVec3 &gradient, PxReal tolerance = PX_MAX_F32)
-
inline void PxSeparateSwingTwist(const PxQuat &q, PxQuat &swing, PxQuat &twist)
Compute from an input quaternion q a pair of quaternions (swing, twist) such that q = swing * twist with the caveats that swing.x = twist.y = twist.z = 0.
- Parameters
q – [in] is the quaternion to be decomposed into swing and twist quaternions.
swing – [out] is the swing component of the quaternion decomposition.
twist – [out] is the twist component of the quaternion decomposition.
-
PxQuat PxShortestRotation(const PxVec3 &from, const PxVec3 &target)
finds the shortest rotation between two vectors.
- Parameters
from – [in] the vector to start from
target – [in] the vector to rotate to
- Returns
a rotation about an axis normal to the two vectors which takes one to the other via the shortest path
-
inline PxQuat PxSlerp(const PxReal t, const PxQuat &left, const PxQuat &right)
Spherical linear interpolation of two quaternions.
- Parameters
t – [in] is the interpolation parameter in range (0, 1)
left – [in] is the start of the interpolation
right – [in] is the end of the interpolation
- Returns
Returns left when t=0, right when t=1 and a linear interpolation of left and right when 0 < t < 1. Returns angle between -PI and PI in radians
-
inline PxReal PxTanHalf(PxReal sin, PxReal cos)
Compute tan(theta/2) given sin(theta) and cos(theta) as inputs.
- Parameters
sin – [in] has value sin(theta)
cos – [in] has value cos(theta)
- Returns
Returns tan(theta/2)
-
PxTransform PxTransformFromPlaneEquation(const PxPlane &plane)
creates a transform from a plane equation, suitable for an actor transform for a PxPlaneGeometry
- Parameters
plane – [in] the desired plane equation
- Returns
a PxTransform which will transform the plane PxPlane(1,0,0,0) to the specified plane
-
PxTransform PxTransformFromSegment(const PxVec3 &p0, const PxVec3 &p1, PxReal *halfHeight = NULL)
creates a transform from the endpoints of a segment, suitable for an actor transform for a PxCapsuleGeometry
- Parameters
p0 – [in] one end of major axis of the capsule
p1 – [in] the other end of the axis of the capsule
halfHeight – [out] the halfHeight of the capsule. This parameter is optional.
- Returns
A PxTransform which will transform the vector (1,0,0) to the capsule axis shrunk by the halfHeight
Typedefs
-
typedef PxFlags<PxBaseFlag::Enum, PxU16> PxBaseFlags
-
typedef void (*PxBinaryMetaDataCallback)(PxOutputStream &stream)
Callback type for exporting binary meta data for a serializable type.
- Deprecated:
Binary conversion and binary meta data are deprecated.
- Param stream
Stream to store binary meta data.
-
typedef PxU64 PxSerialObjectId
ID type for PxBase objects in a PxCollection.