RavEngine
Loading...
Searching...
No Matches
physx::Gu::HeightField Class Reference
Inheritance diagram for physx::Gu::HeightField:
[legend]
Collaboration diagram for physx::Gu::HeightField:
[legend]

Public Member Functions

 HeightField (PxBaseFlags baseFlags)
 
void preExportDataReset ()
 
virtual void exportExtraData (PxSerializationContext &context)
 
void importExtraData (PxDeserializationContext &context)
 
PX_FORCE_INLINE void setMeshFactory (MeshFactory *f)
 
void resolveReferences (PxDeserializationContext &)
 
virtual void requiresObjects (PxProcessPxBaseCallback &)
 
 HeightField (MeshFactory *factory)
 
 HeightField (MeshFactory *factory, Gu::HeightFieldData &data)
 
virtual void release ()
 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
 Writes out the sample data array.
 
virtual bool modifySamples (PxI32 startCol, PxI32 startRow, const PxHeightFieldDesc &subfieldDesc, bool shrinkBounds)
 Replaces a rectangular subfield in the sample data array.
 
virtual PxU32 getNbRows () const
 Retrieves the number of sample rows in the samples array.
 
virtual PxU32 getNbColumns () const
 Retrieves the number of sample columns in the samples array.
 
virtual PxHeightFieldFormat::Enum getFormat () const
 Retrieves the format of the sample data.
 
virtual PxU32 getSampleStride () const
 Retrieves the offset in bytes between consecutive samples in the array.
 
virtual PxReal getConvexEdgeThreshold () const
 Retrieves the convex edge threshold.
 
virtual PxHeightFieldFlags getFlags () const
 Retrieves the flags bits, combined from values of the enum ::PxHeightFieldFlag.
 
virtual PxReal getHeight (PxReal x, PxReal z) const
 Retrieves the height at the given coordinates in grid space.
 
virtual PxMaterialTableIndex getTriangleMaterialIndex (PxTriangleID triangleIndex) const
 Returns material table index of given triangle.
 
virtual PxVec3 getTriangleNormal (PxTriangleID triangleIndex) const
 Returns a triangle face normal for a given triangle index.
 
virtual const PxHeightFieldSample & getSample (PxU32 row, PxU32 column) const
 Returns heightfield sample of given row and column

 
virtual PxU32 getTimestamp () const
 Returns the number of times the heightfield data has been modified.
 
virtual void acquireReference ()
 Acquires a counted reference to this object.
 
virtual PxU32 getReferenceCount () const
 Returns the reference count of the object.
 
virtual void onRefCountZero ()
 
bool loadFromDesc (const PxHeightFieldDesc &)
 
bool load (PxInputStream &)
 
bool save (PxOutputStream &stream, bool endianSwap)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getNbRowsFast () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getNbColumnsFast () const
 
PX_FORCE_INLINE PxHeightFieldFormat::Enum getFormatFast () const
 
PX_FORCE_INLINE PxU32 getFlagsFast () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isZerothVertexShared (PxU32 vertexIndex) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU16 getMaterialIndex0 (PxU32 vertexIndex) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU16 getMaterialIndex1 (PxU32 vertexIndex) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMaterialIndex01 (PxU32 vertexIndex) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal getHeight (PxU32 vertexIndex) const
 
PX_INLINE PxReal getHeightInternal2 (PxU32 vertexIndex, PxReal fracX, PxReal fracZ) const
 
PX_FORCE_INLINE PxReal getHeightInternal (PxReal x, PxReal z) const
 
PX_FORCE_INLINE bool isValidVertex (PxU32 vertexIndex) const
 
PX_INLINE PxVec3 getVertex (PxU32 vertexIndex) const
 
PX_INLINE bool isConvexVertex (PxU32 vertexIndex, PxU32 row, PxU32 column) const
 
PX_INLINE bool isValidEdge (PxU32 edgeIndex) const
 
PX_INLINE PxU32 getEdgeTriangleIndices (PxU32 edgeIndex, PxU32 triangleIndices[2]) const
 
PX_INLINE PxU32 getEdgeTriangleIndices (PxU32 edgeIndex, PxU32 triangleIndices[2], PxU32 cell, PxU32 row, PxU32 column) const
 
PX_INLINE void getEdgeVertexIndices (PxU32 edgeIndex, PxU32 &vertexIndex0, PxU32 &vertexIndex1) const
 
PX_INLINE bool isConvexEdge (PxU32 edgeIndex, PxU32 cell, PxU32 row, PxU32 column) const
 
PX_FORCE_INLINE bool isConvexEdge (PxU32 edgeIndex) const
 
PxU32 computeCellCoordinates (PxReal x, PxReal z, PxReal &fracX, PxReal &fracZ) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMin (PxReal x, PxU32 nb) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMax (PxReal x, PxU32 nb) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMinRow (PxReal x) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMaxRow (PxReal x) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMinColumn (PxReal z) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU32 getMaxColumn (PxReal z) const
 
PX_CUDA_CALLABLE PX_INLINE bool isValidTriangle (PxU32 triangleIndex) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFirstTriangle (PxU32 triangleIndex) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxU16 getTriangleMaterial (PxU32 triangleIndex) const
 
PX_CUDA_CALLABLE PX_INLINE void getTriangleVertexIndices (PxU32 triangleIndex, PxU32 &vertexIndex0, PxU32 &vertexIndex1, PxU32 &vertexIndex2) const
 
PX_CUDA_CALLABLE PX_INLINE PxVec3 getTriangleNormalInternal (PxU32 triangleIndex) const
 
PX_INLINE void getTriangleAdjacencyIndices (PxU32 triangleIndex, PxU32 vertexIndex0, PxU32 vertexIndex1, PxU32 vertexIndex2, PxU32 &adjacencyIndex0, PxU32 &adjacencyIndex1, PxU32 &adjacencyIndex2) const
 
PX_INLINE PxVec3 getNormal_2 (PxU32 vertexIndex, PxReal fracX, PxReal fracZ, PxReal xcoeff, PxReal ycoeff, PxReal zcoeff) const
 
PX_FORCE_INLINE PxVec3 getNormal_ (PxReal x, PxReal z, PxReal xcoeff, PxReal ycoeff, PxReal zcoeff) const
 
PX_INLINE PxU32 getTriangleIndex (PxReal x, PxReal z) const
 
PX_INLINE PxU32 getTriangleIndex2 (PxU32 cell, PxReal fracX, PxReal fracZ) const
 
PX_FORCE_INLINE PxU16 getMaterial (PxReal x, PxReal z) const
 
PX_FORCE_INLINE PxReal getMinHeight () const
 
PX_FORCE_INLINE PxReal getMaxHeight () const
 
PX_FORCE_INLINE const Gu::HeightFieldData & getData () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void getTriangleVertices (PxU32 triangleIndex, PxU32 row, PxU32 column, PxVec3 &v0, PxVec3 &v1, PxVec3 &v2) const
 
bool isSolidVertex (PxU32 vertexIndex, PxU32 row, PxU32 coloumn, PxU16 holeMaterialIndex, bool &nbSolid) const
 
PX_PHYSX_COMMON_API bool isCollisionVertexPreca (PxU32 vertexIndex, PxU32 row, PxU32 column, PxU16 holeMaterialIndex) const
 
void parseTrianglesForCollisionVertices (PxU16 holeMaterialIndex)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxHeightFieldSample & getSample (PxU32 vertexIndex) const
 
void releaseMemory ()
 
- Public Member Functions inherited from physx::PxHeightField
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type.
 
- 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.
 
- Public Member Functions inherited from physx::PxUserAllocated
PX_INLINE void * operator new (size_t, void *address)
 
PX_INLINE void operator delete (void *, void *)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete (void *ptr, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete[] (void *ptr, Alloc alloc, const char *fileName, int line)
 
PX_INLINE void operator delete (void *ptr)
 
PX_INLINE void operator delete[] (void *ptr)
 

Static Public Member Functions

static PX_PHYSX_COMMON_API HeightField * createObject (PxU8 *&address, PxDeserializationContext &context)
 
static PX_PHYSX_COMMON_API void getBinaryMetaData (PxOutputStream &stream)
 

Public Attributes

Gu::HeightFieldData mData
 
PxU32 mSampleStride
 
PxU32 mNbSamples
 
PxReal mMinHeight
 
PxReal mMaxHeight
 
PxU32 mModifyCount
 

Additional Inherited Members

- Protected Member Functions inherited from physx::PxHeightField
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
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
 
- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Member Function Documentation

◆ acquireReference()

void HeightField::acquireReference ( )
virtual

Acquires a counted reference to this object.

This method increases the reference count of the object by 1. Decrement the reference count by calling release()

Implements physx::PxRefCounted.

◆ getConvexEdgeThreshold()

virtual PxReal physx::Gu::HeightField::getConvexEdgeThreshold ( ) const
inlinevirtual

Retrieves the convex edge threshold.

Returns
The convex edge threshold.
See also
PxHeightFieldDesc.convexEdgeThreshold

Implements physx::PxHeightField.

◆ getFlags()

virtual PxHeightFieldFlags physx::Gu::HeightField::getFlags ( ) const
inlinevirtual

Retrieves the flags bits, combined from values of the enum ::PxHeightFieldFlag.

Returns
The flags bits, combined from values of the enum ::PxHeightFieldFlag.
See also
PxHeightFieldDesc.flags PxHeightFieldFlag

Implements physx::PxHeightField.

◆ getFormat()

virtual PxHeightFieldFormat::Enum physx::Gu::HeightField::getFormat ( ) const
inlinevirtual

Retrieves the format of the sample data.

Returns
The format of the sample data.
See also
PxHeightFieldDesc.format PxHeightFieldFormat

Implements physx::PxHeightField.

◆ getHeight()

virtual PxReal physx::Gu::HeightField::getHeight ( PxReal  x,
PxReal  z 
) const
inlinevirtual

Retrieves the height at the given coordinates in grid space.

Returns
The height at the given coordinates or 0 if the coordinates are out of range.

Implements physx::PxHeightField.

◆ getNbColumns()

virtual PxU32 physx::Gu::HeightField::getNbColumns ( ) const
inlinevirtual

Retrieves the number of sample columns in the samples array.

Returns
The number of sample columns in the samples array.
See also
PxHeightFieldDesc.nbColumns

Implements physx::PxHeightField.

◆ getNbRows()

virtual PxU32 physx::Gu::HeightField::getNbRows ( ) const
inlinevirtual

Retrieves the number of sample rows in the samples array.

Returns
The number of sample rows in the samples array.
See also
PxHeightFieldDesc.nbRows

Implements physx::PxHeightField.

◆ getReferenceCount()

PxU32 HeightField::getReferenceCount ( ) const
virtual

Returns the reference count of the object.

At creation, the reference count of the object is 1. Every other object referencing this object increments the count by 1. When the reference count reaches 0, and only then, the object gets destroyed automatically.

Returns
the current reference count.

Implements physx::PxRefCounted.

◆ getSample()

virtual const PxHeightFieldSample & physx::Gu::HeightField::getSample ( PxU32  row,
PxU32  column 
) const
inlinevirtual

Returns heightfield sample of given row and column

Parameters
[in]rowGiven heightfield row
[in]columnGiven heightfield column
Returns
Heightfield sample

Implements physx::PxHeightField.

◆ getSampleStride()

virtual PxU32 physx::Gu::HeightField::getSampleStride ( ) const
inlinevirtual

Retrieves the offset in bytes between consecutive samples in the array.

Returns
The offset in bytes between consecutive samples in the array.
See also
PxHeightFieldDesc.sampleStride

Implements physx::PxHeightField.

◆ getTimestamp()

virtual PxU32 physx::Gu::HeightField::getTimestamp ( ) const
inlinevirtual

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.

Returns
the number of times the heightfield sample data has been modified.

Implements physx::PxHeightField.

◆ getTriangleMaterialIndex()

virtual PxMaterialTableIndex physx::Gu::HeightField::getTriangleMaterialIndex ( PxTriangleID  triangleIndex) const
inlinevirtual

Returns material table index of given triangle.

Note
This function takes a post cooking triangle index.
Parameters
[in]triangleIndex(internal) index of desired triangle
Returns
Material table index, or 0xffff if no per-triangle materials are used

Implements physx::PxHeightField.

◆ getTriangleNormal()

virtual PxVec3 physx::Gu::HeightField::getTriangleNormal ( PxTriangleID  triangleIndex) const
inlinevirtual

Returns a triangle face normal for a given triangle index.

Note
This function takes a post cooking triangle index.
Parameters
[in]triangleIndex(internal) index of desired triangle
Returns
Triangle normal for a given triangle index

Implements physx::PxHeightField.

◆ modifySamples()

bool HeightField::modifySamples ( PxI32  startCol,
PxI32  startRow,
const PxHeightFieldDesc &  subfieldDesc,
bool  shrinkBounds 
)
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.

Parameters
[in]startColFirst cell in the destination heightfield to be modified. Can be negative.
[in]startRowFirst row in the destination heightfield to be modified. Can be negative.
[in]subfieldDescDescription of the source subfield to read the samples from.
[in]shrinkBoundsIf 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.
Returns
True on success, false on failure. Failure can occur due to format mismatch.
Note
Modified samples are constrained to the same height quantization range as the original heightfield. Source samples that are out of range of target heightfield will be clipped with no error. PhysX does not keep a mapping from the heightfield to heightfield shapes that reference it. Call PxShape::setGeometry on each shape which references the height field, to ensure that internal data structures are updated to reflect the new geometry. Please note that PxShape::setGeometry does not guarantee correct/continuous behavior when objects are resting on top of old or new geometry.
See also
PxHeightFieldDesc.samples PxShape.setGeometry

Implements physx::PxHeightField.

◆ onRefCountZero()

void HeightField::onRefCountZero ( )
virtual

Reimplemented from physx::PxRefCounted.

◆ release()

void HeightField::release ( )
virtual

Decrements the reference count of a height field and releases it if the new reference count is zero.

See also
PxPhysics.createHeightField() PxHeightFieldDesc PxHeightFieldGeometry PxShape

Implements physx::PxHeightField.

◆ saveCells()

PxU32 HeightField::saveCells ( void *  destBuffer,
PxU32  destBufferSize 
) const
virtual

Writes out the sample data array.

The user provides destBufferSize bytes storage at destBuffer. The data is formatted and arranged as PxHeightFieldDesc.samples.

Parameters
[out]destBufferThe destination buffer for the sample data.
[in]destBufferSizeThe size of the destination buffer.
Returns
The number of bytes written.
See also
PxHeightFieldDesc.samples

Implements physx::PxHeightField.


The documentation for this class was generated from the following files: