Foundation

Classes

Macros

Enumerations

  • PxEMPTY: enum for empty constructor tag

  • PxIDENTITY: enum for identity constructor flag for quaternions, transforms, and matrices

  • PxZERO: enum for zero constructor tag for vectors and matrices

Functions

Structs

Typedefs

Variables

Enumerations

enum PxEMPTY

enum for empty constructor tag

Values:

enumerator PxEmpty
enum PxIDENTITY

enum for identity constructor flag for quaternions, transforms, and matrices

Values:

enumerator PxIdentity
enum PxZERO

enum for zero constructor tag for vectors and matrices

Values:

enumerator PxZero

Functions

template<class T>
inline void PX_UNUSED(T const&)
inline float PxAbs(float a)

abs returns the absolute value of its argument.

inline double PxAbs(double a)

abs returns the absolute value of its argument.

inline int32_t PxAbs(int32_t a)

abs returns the absolute value of its argument.

inline double PxAcos(double f)

Arccosine.

Returns angle between 0 and PI in radians Unit: Radians

inline float PxAcos(float f)

Arccosine.

Returns angle between 0 and PI in radians Unit: Radians

inline float PxAsin(float f)

Arcsine.

Returns angle between -PI/2 and PI/2 in radians Unit: Radians

inline double PxAsin(double f)

Arcsine.

Returns angle between -PI/2 and PI/2 in radians Unit: Radians

void PxAssert(const char *exp, const char *file, int line, bool &ignore)

Built-in assert function.

inline double PxAtan(double a)

ArcTangent.

Returns angle between -PI/2 and PI/2 in radians Unit: Radians

inline float PxAtan(float a)

ArcTangent.

Returns angle between -PI/2 and PI/2 in radians Unit: Radians

inline float PxAtan2(float x, float y)

Arctangent of (x/y) with correct sign.

Returns angle between -PI and PI in radians Unit: Radians

inline double PxAtan2(double x, double y)

Arctangent of (x/y) with correct sign.

Returns angle between -PI and PI in radians Unit: Radians

inline float PxCeil(float a)
template<class T>
inline T PxClamp(T v, T lo, T hi)

Clamps v to the range [hi,lo].

inline float PxCos(float a)

Cosine of an angle (Unit: Radians)

inline double PxCos(double a)

Cosine of an angle (Unit: Radians)

physx::PxFoundation *PxCreateFoundation(physx::PxU32 version, physx::PxAllocatorCallback &allocator, physx::PxErrorCallback &errorCallback)

Creates an instance of the foundation class.

The foundation class is needed to initialize higher level SDKs. There may be only one instance per process. Calling this method after an instance has been created already will result in an error message and NULL will be returned.

See also

PxFoundation

Parameters
  • version – Version number we are expecting (should be PX_PHYSICS_VERSION)

  • allocator – User supplied interface for allocating memory(see PxAllocatorCallback)

  • errorCallback – User supplied interface for reporting errors and displaying messages(see PxErrorCallback)

Returns

Foundation instance on success, NULL if operation failed

void PxDecFoundationRefCount()

Decrement the ref count of PxFoundation.

inline PxF32 PxDegToRad(const PxF32 a)

Converts degrees to radians.

inline bool PxEquals(float a, float b, float eps)
inline float PxExp(float a)
inline float PxFloor(float a)
physx::PxAllocatorCallback *PxGetAllocatorCallback()

Get the allocator callback.

physx::PxAllocatorCallback *PxGetBroadcastAllocator(bool *reportAllocationNames = NULL)

Get the broadcasting allocator callback.

physx::PxErrorCallback *PxGetBroadcastError()

Get the broadcasting error callback.

physx::PxErrorCallback *PxGetErrorCallback()

Get the error callback.

physx::PxFoundation &PxGetFoundation()

Retrieves the Foundation SDK after it has been created.

Note

The behavior of this method is undefined if the foundation instance has not been created already.

physx::PxProfilerCallback *PxGetProfilerCallback()

Get the callback that will be used for all profiling.

inline PxQuat PxGetRotXQuat(float angle)

Returns a rotation quaternion around the X axis.

Parameters

angle – [in] desired angle

Returns

Quaternion that rotates around the desired axis

inline PxQuat PxGetRotYQuat(float angle)

Returns a rotation quaternion around the Y axis.

Parameters

angle – [in] desired angle

Returns

Quaternion that rotates around the desired axis

inline PxQuat PxGetRotZQuat(float angle)

Returns a rotation quaternion around the Z axis.

Parameters

angle – [in] desired angle

Returns

Quaternion that rotates around the desired axis

physx::PxU32 PxGetWarnOnceTimeStamp()

Get the warn once timestamp.

void PxIncFoundationRefCount()

Increment the ref count of PxFoundation.

inline bool PxIsFinite(double f)

returns true if the passed number is a finite floating point number as opposed to INF, NAN, etc.

inline bool PxIsFinite(float f)

returns true if the passed number is a finite floating point number as opposed to INF, NAN, etc.

physx::PxFoundation *PxIsFoundationValid()

Similar to PxGetFoundation() except it handles the case if the foundation was not created already.

Returns

Pointer to the foundation if an instance is currently available, otherwise null.

inline float PxLog(float x)
template<typename T>
inline PxStrideIterator<const T> PxMakeIterator(const T *ptr, PxU32 stride = sizeof(T))

Stride iterator factory function which infers the iterator type.

template<typename T>
inline PxStrideIterator<T> PxMakeIterator(T *ptr, PxU32 stride = sizeof(T))

Stride iterator factory function which infers the iterator type.

inline void PxMarkSerializedMemory(void *ptr, PxU32 byteSize)

Mark a specified amount of memory with 0xcd pattern.

This is used to check that the meta data definition for serialized classes is complete in checked builds.

Parameters
  • ptr – [out] Pointer to block of memory to initialize.

  • byteSize – [in] Number of bytes to initialize.

template<>
inline float PxMax(float a, float b)

overload for float to use fsel on xbox

template<class T>
inline T PxMax(T a, T b)

The return value is the greater of the two specified values.

template<class T, class Predicate>
inline void PxMedian3(T *elements, int32_t first, int32_t last, Predicate &compare)
inline void *PxMemCopy(void *dest, const void *src, PxU32 count)

Copies the bytes of one memory block to another.

The memory blocks must not overlap.

Note

Use PxMemMove if memory blocks overlap.

Parameters
  • dest – [out] Pointer to block of memory to copy to.

  • src – [in] Pointer to block of memory to copy from.

  • count – [in] Number of bytes to copy.

Returns

Pointer to destination memory block

inline void *PxMemMove(void *dest, const void *src, PxU32 count)

Copies the bytes of one memory block to another.

The memory blocks can overlap.

Note

Use PxMemCopy if memory blocks do not overlap.

Parameters
  • dest – [out] Pointer to block of memory to copy to.

  • src – [in] Pointer to block of memory to copy from.

  • count – [in] Number of bytes to copy.

Returns

Pointer to destination memory block

inline void *PxMemSet(void *dest, PxI32 c, PxU32 count)

Sets the bytes of the provided buffer to the specified value.

Parameters
  • dest – [out] Pointer to block of memory to set to the specified value.

  • c – [in] Value to set the bytes of the block of memory to.

  • count – [in] Number of bytes to set to the specified value.

Returns

Pointer to memory block (same as input)

inline void *PxMemZero(void *dest, PxU32 count)

Sets the bytes of the provided buffer to zero.

Parameters
  • dest – [out] Pointer to block of memory to set zero.

  • count – [in] Number of bytes to set to zero.

Returns

Pointer to memory block (same as input)

template<>
inline float PxMin(float a, float b)

overload for float to use fsel on xbox

template<class T>
inline T PxMin(T a, T b)

The return value is the lesser of the two specified values.

template<class T, class Predicate>
inline int32_t PxPartition(T *elements, int32_t first, int32_t last, Predicate &compare)
inline float PxPow(float x, float y)
inline double PxRecipSqrt(double a)

reciprocal square root.

inline float PxRecipSqrt(float a)

reciprocal square root.

void PxSetFoundationInstance(physx::PxFoundation &foundation)
void PxSetPhysXCommonDelayLoadHook(const physx::PxDelayLoadHook *hook)

Sets delay load hook instance for PhysXCommon dll.

See also

PxDelayLoadHook

Parameters

hook[in] Delay load hook.

void PxSetPhysXCookingDelayLoadHook(const physx::PxDelayLoadHook *hook)

Sets delay load hook instance for PhysXCooking dll.

See also

PxDelayLoadHook

Parameters

hook[in] Delay load hook.

void PxSetPhysXDelayLoadHook(const physx::PxDelayLoadHook *hook)

Sets delay load hook instance for PhysX dll.

See also

PxDelayLoadHook

Parameters

hook[in] Delay load hook.

void PxSetProfilerCallback(physx::PxProfilerCallback *profiler)

Set the callback that will be used for all profiling.

inline void PxSetRotX(PxMat33 &m, PxReal angle)

Sets a rotation matrix around the X axis.

Parameters
  • m – [out] output rotation matrix

  • angle – [in] desired angle

inline void PxSetRotY(PxMat33 &m, PxReal angle)

Sets a rotation matrix around the Y axis.

Parameters
  • m – [out] output rotation matrix

  • angle – [in] desired angle

inline void PxSetRotZ(PxMat33 &m, PxReal angle)

Sets a rotation matrix around the Z axis.

Parameters
  • m – [out] output rotation matrix

  • angle – [in] desired angle

inline float PxSign(float a)
inline float PxSign2(float a, float eps = FLT_EPSILON)
inline float PxSin(float a)

trigonometry &#8212; all angles are in radians.

Sine of an angle ( Unit: Radians )

inline double PxSin(double a)

Sine of an angle ( Unit: Radians )

inline void PxSinCos(const PxF32 a, PxF32 &sin, PxF32 &cos)

compute sine and cosine at the same time

inline void PxSinCos(const double a, double &sin, double &cos)

compute sine and cosine at the same time

template<class T, class Predicate>
inline void PxSmallSort(T *elements, int32_t first, int32_t last, Predicate &compare)
template<class T, class Predicate>
void PxSort(T *elements, uint32_t count, const Predicate &compare)
template<class T, class Predicate, class PxAllocator>
void PxSort(T *elements, uint32_t count, const Predicate &compare, const PxAllocator &inAllocator, const uint32_t initialStackSize = 32)

Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:

See also

PxLess, PxGreater

template<class T>
void PxSort(T *elements, uint32_t count)
inline PxF32 PxSqr(const PxF32 a)

square of the argument

inline float PxSqrt(float a)

Square root.

inline double PxSqrt(double a)

Square root.

inline double PxTan(double a)

Tangent of an angle.

Unit: Radians

inline float PxTan(float a)

Tangent of an angle.

Unit: Radians

template<class A, class B>
inline A PxUnionCast(B b)
template<class Type>
static inline PxVec3T<Type> operator*(Type f, const PxVec3T<Type> &v)
template<class Type>
static inline PxVec2T<Type> operator*(Type f, const PxVec2T<Type> &v)
template<class Type>
inline PxMat34T<Type> operator*(const PxMat33T<Type> &a, const PxMat34T<Type> &b)

Multiply a*b, a is extended.

template<class Type>
static inline PxVec4T<Type> operator*(Type f, const PxVec4T<Type> &v)
template<class Type>
inline PxMat33T<Type> operator*(Type scalar, const PxMat33T<Type> &m)
template<typename T>
inline PxStrideIterator<T> operator+(int i, PxStrideIterator<T> it)

Addition operator.

Typedefs

typedef PxBitAndDataT<PxU8, 0x80> PxBitAndByte
typedef PxBitAndDataT<PxU32, 0x80000000> PxBitAndDword
typedef PxBitAndDataT<PxU16, 0x8000> PxBitAndWord
typedef float PxF32
typedef double PxF64
typedef int16_t PxI16
typedef int32_t PxI32
typedef int64_t PxI64
typedef int8_t PxI8
typedef PxI32 PxIntBool
typedef PxMat33T<float> PxMat33
typedef PxMat33T<double> PxMat33d
typedef PxMat34T<float> PxMat34
typedef PxMat34T<double> PxMat34d
typedef PxMat44T<float> PxMat44
typedef PxMat44T<double> PxMat44d
typedef PxQuatT<float> PxQuat
typedef PxQuatT<double> PxQuatd
typedef float PxReal
typedef PxTransformT<float> PxTransform
typedef PxTransformPadded PxTransform32
typedef PxTransformT<double> PxTransformd
typedef uint16_t PxU16
typedef uint32_t PxU32

files to always include

typedef uint64_t PxU64
typedef uint8_t PxU8
typedef PxVec2T<float> PxVec2
typedef PxVec2T<double> PxVec2d
typedef PxVec3T<float> PxVec3
typedef PxVec3T<double> PxVec3d
typedef PxVec3Padded PxVec3p
typedef PxVec4T<float> PxVec4
typedef PxVec4T<double> PxVec4d

Variables

static const float PxHalfPi = float(1.57079632679489661923)
static const PxIntBool PxIntFalse = 0
static const PxIntBool PxIntTrue = 1
static const float PxInvPi = float(0.31830988618379067154)
static const float PxInvSqrt2 = float(0.7071067811865476)
static const float PxInvTwoPi = float(0.15915494309189533577)
static const float PxPi = float(3.141592653589793)
static const float PxPiDivFour = float(0.78539816339744830962)
static const float PxPiDivTwo = float(1.57079632679489661923)
static const float PxSqrt2 = float(1.4142135623730951)
static const float PxTwoPi = float(6.28318530717958647692)