|
RavEngine
|
A height field class. More...
#include <PxHeightField.h>
Public Member Functions | |
| virtual void | release ()=0 |
| Decrements the reference count of a height field and releases it if the new reference count is zero. | |
| virtual PxU32 | saveCells (void *destBuffer, PxU32 destBufferSize) const =0 |
| Writes out the sample data array. | |
| virtual bool | modifySamples (PxI32 startCol, PxI32 startRow, const PxHeightFieldDesc &subfieldDesc, bool shrinkBounds=false)=0 |
| Replaces a rectangular subfield in the sample data array. | |
| virtual PxU32 | getNbRows () const =0 |
| Retrieves the number of sample rows in the samples array. | |
| virtual PxU32 | getNbColumns () const =0 |
| Retrieves the number of sample columns in the samples array. | |
| virtual PxHeightFieldFormat::Enum | getFormat () const =0 |
| Retrieves the format of the sample data. | |
| virtual PxU32 | getSampleStride () const =0 |
| Retrieves the offset in bytes between consecutive samples in the array. | |
| virtual PxReal | getConvexEdgeThreshold () const =0 |
| Retrieves the convex edge threshold. | |
| virtual PxHeightFieldFlags | getFlags () const =0 |
| Retrieves the flags bits, combined from values of the enum ::PxHeightFieldFlag. | |
| virtual PxReal | getHeight (PxReal x, PxReal z) const =0 |
| Retrieves the height at the given coordinates in grid space. | |
| virtual PxMaterialTableIndex | getTriangleMaterialIndex (PxTriangleID triangleIndex) const =0 |
| Returns material table index of given triangle. | |
| virtual PxVec3 | getTriangleNormal (PxTriangleID triangleIndex) const =0 |
| Returns a triangle face normal for a given triangle index. | |
| virtual const PxHeightFieldSample & | getSample (PxU32 row, PxU32 column) const =0 |
| Returns heightfield sample of given row and column | |
| virtual PxU32 | getTimestamp () const =0 |
| Returns the number of times the heightfield data has been modified. | |
| virtual const char * | getConcreteTypeName () const |
| Returns string name of dynamic type. | |
Public Member Functions inherited from physx::PxRefCounted | |
| virtual PxU32 | getReferenceCount () const =0 |
| Returns the reference count of the object. | |
| virtual void | acquireReference ()=0 |
| Acquires a counted reference to this object. | |
Public Member Functions inherited from physx::PxBase | |
| template<class T > | |
| T * | is () |
| template<class T > | |
| const T * | is () const |
| PX_FORCE_INLINE PxType | getConcreteType () const |
| Returns concrete type of object. | |
| PX_FORCE_INLINE void | setBaseFlag (PxBaseFlag::Enum flag, bool value) |
| Set PxBaseFlag | |
| PX_FORCE_INLINE void | setBaseFlags (PxBaseFlags inFlags) |
| Set PxBaseFlags | |
| PX_FORCE_INLINE PxBaseFlags | getBaseFlags () const |
| Returns PxBaseFlags. | |
| virtual bool | isReleasable () const |
| Whether the object is subordinate. | |
Protected Member Functions | |
| PX_INLINE | PxHeightField (PxType concreteType, PxBaseFlags baseFlags) |
| PX_INLINE | PxHeightField (PxBaseFlags baseFlags) |
| virtual bool | isKindOf (const char *name) const |
| Returns whether a given type name matches with the type of this instance. | |
Protected Member Functions inherited from physx::PxRefCounted | |
| virtual void | onRefCountZero () |
| PX_INLINE | PxRefCounted (PxType concreteType, PxBaseFlags baseFlags) |
| PX_INLINE | PxRefCounted (PxBaseFlags baseFlags) |
Protected Member Functions inherited from physx::PxBase | |
| PX_INLINE | PxBase (PxType concreteType, PxBaseFlags baseFlags) |
| Constructor setting concrete type and base flags. | |
| PX_INLINE | PxBase (PxBaseFlags baseFlags) |
| Deserialization constructor setting base flags. | |
| virtual | ~PxBase () |
| Destructor. | |
| template<class T > | |
| bool | typeMatch () const |
Additional Inherited Members | |
Protected Attributes inherited from physx::PxBase | |
| PxType | mConcreteType |
| PxBaseFlags | mBaseFlags |
| PxU32 | mBuiltInRefCount |
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() or PxCooking::createHeightField(const PxHeightFieldDesc&, PxInsertionCallback&). To delete it call release(). This is only possible once you have released all of its PxHeightFiedShape instances.
|
inlinevirtual |
Returns string name of dynamic type.
Implements physx::PxBase.
|
pure virtual |
Retrieves the convex edge threshold.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Retrieves the flags bits, combined from values of the enum ::PxHeightFieldFlag.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Retrieves the format of the sample data.
Implemented in physx::Gu::HeightField.
Retrieves the height at the given coordinates in grid space.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Retrieves the number of sample columns in the samples array.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Retrieves the number of sample rows in the samples array.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Returns heightfield sample of given row and column
| [in] | row | Given heightfield row |
| [in] | column | Given heightfield column |
Implemented in physx::Gu::HeightField.
|
pure virtual |
Retrieves the offset in bytes between consecutive samples in the array.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Returns the number of times the heightfield data has been modified.
This method returns the number of times modifySamples has been called on this heightfield, so that code that has retained state that depends on the heightfield can efficiently determine whether it has been modified.
Implemented in physx::Gu::HeightField.
|
pure virtual |
Returns material table index of given triangle.
| [in] | triangleIndex | (internal) index of desired triangle |
Implemented in physx::Gu::HeightField.
|
pure virtual |
Returns a triangle face normal for a given triangle index.
| [in] | triangleIndex | (internal) index of desired triangle |
Implemented in physx::Gu::HeightField.
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from physx::PxRefCounted.
|
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. |
Implemented in physx::Gu::HeightField.
|
pure virtual |
Decrements the reference count of a height field and releases it if the new reference count is zero.
Implements physx::PxRefCounted.
Implemented in physx::Gu::HeightField.
|
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. |
Implemented in physx::Gu::HeightField.