A height field class. More...
#include <PxHeightField.h>
Public Member Functions | |
virtual PX_PHYSX_COMMON_API void | release ()=0 |
Decrements the reference count of a height field and releases it if the new reference count is zero. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | saveCells (void *destBuffer, PxU32 destBufferSize) const =0 |
Writes out the sample data array. More... | |
virtual PX_PHYSX_COMMON_API bool | modifySamples (PxI32 startCol, PxI32 startRow, const PxHeightFieldDesc &subfieldDesc, bool shrinkBounds=false)=0 |
Replaces a rectangular subfield in the sample data array. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | getNbRows () const =0 |
Retrieves the number of sample rows in the samples array. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | getNbColumns () const =0 |
Retrieves the number of sample columns in the samples array. More... | |
virtual PX_PHYSX_COMMON_API PxHeightFieldFormat::Enum | getFormat () const =0 |
Retrieves the format of the sample data. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | getSampleStride () const =0 |
Retrieves the offset in bytes between consecutive samples in the array. More... | |
virtual PX_PHYSX_COMMON_API PxReal | getThickness () const =0 |
Retrieves the thickness of the height volume in the vertical direction. More... | |
virtual PX_PHYSX_COMMON_API PxReal | getConvexEdgeThreshold () const =0 |
Retrieves the convex edge threshold. More... | |
virtual PX_PHYSX_COMMON_API PxHeightFieldFlags | getFlags () const =0 |
Retrieves the flags bits, combined from values of the enum PxHeightFieldFlag. More... | |
virtual PX_PHYSX_COMMON_API PxReal | getHeight (PxReal x, PxReal z) const =0 |
Retrieves the height at the given coordinates in grid space. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | getReferenceCount () const =0 |
Returns the reference count for shared heightfields. More... | |
virtual PX_PHYSX_COMMON_API PxMaterialTableIndex | getTriangleMaterialIndex (PxTriangleID triangleIndex) const =0 |
Returns material table index of given triangle. More... | |
virtual PX_PHYSX_COMMON_API PxVec3 | getTriangleNormal (PxTriangleID triangleIndex) const =0 |
Returns a triangle face normal for a given triangle index. More... | |
virtual PX_PHYSX_COMMON_API const char * | getConcreteTypeName () const |
Returns string name of dynamic type. More... | |
Public Member Functions inherited from PxBase | |
template<class T > | |
T * | is () |
template<class T > | |
const T * | is () const |
PX_INLINE PxType | getConcreteType () const |
Returns concrete type of object. More... | |
PX_INLINE void | setBaseFlag (PxBaseFlag::Enum flag, bool value) |
Set PxBaseFlag. More... | |
PX_INLINE void | setBaseFlags (PxBaseFlags inFlags) |
Set PxBaseFlags. More... | |
PX_INLINE PxBaseFlags | getBaseFlags () const |
Returns PxBaseFlags. More... | |
virtual bool | isReleasable () const |
Whether the object is subordinate. More... | |
Protected Member Functions | |
PX_INLINE | PxHeightField (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxHeightField (PxBaseFlags baseFlags) |
virtual PX_PHYSX_COMMON_API | ~PxHeightField () |
virtual PX_PHYSX_COMMON_API bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. More... | |
Protected Member Functions inherited from PxBase | |
PX_INLINE | PxBase (PxType concreteType, PxBaseFlags baseFlags) |
Constructor setting concrete type and base flags. More... | |
PX_INLINE | PxBase (PxBaseFlags baseFlags) |
Deserialization constructor setting base flags. More... | |
virtual | ~PxBase () |
Destructor. More... | |
template<class T > | |
bool | typeMatch () const |
Additional Inherited Members | |
Protected Attributes inherited from PxBase | |
PxType | mConcreteType |
PxBaseFlags | mBaseFlags |
A height field class.
Height fields work in a similar way as triangle meshes specified to act as height fields, with some important differences:
Triangle meshes can be made of nonuniform geometry, while height fields are regular, rectangular grids. This means that with PxHeightField, you sacrifice flexibility in return for improved performance and decreased memory consumption.
In local space rows extend in X direction, columns in Z direction and height in Y direction.
Like Convexes and TriangleMeshes, HeightFields are referenced by shape instances (see PxHeightFieldGeometry, PxShape).
To avoid duplicating data when you have several instances of a particular height field differently, you do not use this class to represent a height field object directly. Instead, you create an instance of this height field via the PxHeightFieldGeometry and PxShape classes.
To create an instance of this class call PxPhysics::createHeightField(), and release() to delete it. This is only possible once you have released all of its PxHeightFiedShape instances.
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
|
inlinevirtual |
Returns string name of dynamic type.
Reimplemented from PxBase.
|
pure virtual |
Retrieves the convex edge threshold.
|
pure virtual |
Retrieves the flags bits, combined from values of the enum PxHeightFieldFlag.
|
pure virtual |
Retrieves the format of the sample data.
|
pure virtual |
Retrieves the height at the given coordinates in grid space.
|
pure virtual |
Retrieves the number of sample columns in the samples array.
|
pure virtual |
Retrieves the number of sample rows in the samples array.
|
pure virtual |
Returns the reference count for shared heightfields.
At creation, the reference count of the heightfield is 1. Every shape referencing this heightfield increments the count by 1. When the reference count reaches 0, and only then, the heightfield gets destroyed automatically.
|
pure virtual |
Retrieves the offset in bytes between consecutive samples in the array.
|
pure virtual |
Retrieves the thickness of the height volume in the vertical direction.
|
pure virtual |
Returns material table index of given triangle.
[in] | triangleIndex | (internal) index of desired triangle |
|
pure virtual |
Returns a triangle face normal for a given triangle index.
[in] | triangleIndex | (internal) index of desired triangle |
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxBase.
References PxBase::isKindOf().
|
pure virtual |
Replaces a rectangular subfield in the sample data array.
The user provides the description of a rectangular subfield in subfieldDesc. The data is formatted and arranged as PxHeightFieldDesc.samples.
[in] | startCol | First cell in the destination heightfield to be modified. Can be negative. |
[in] | startRow | First row in the destination heightfield to be modified. Can be negative. |
[in] | subfieldDesc | Description of the source subfield to read the samples from. |
[in] | shrinkBounds | If left as false, the bounds will never shrink but only grow. If set to true the bounds will be recomputed from all HF samples at O(nbColums*nbRows) perf cost. |
|
pure virtual |
Decrements the reference count of a height field and releases it if the new reference count is zero.
The height field is destroyed when the application's reference is released and all shapes referencing the height field are destroyed.
Implements PxBase.
|
pure virtual |
Writes out the sample data array.
The user provides destBufferSize bytes storage at destBuffer. The data is formatted and arranged as PxHeightFieldDesc.samples.
[out] | destBuffer | The destination buffer for the sample data. |
[in] | destBufferSize | The size of the destination buffer. |