Note: The heightfield data is *copied* when a PxHeightField object is created from this descriptor. After the call the user may discard the height data.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructor sets to default.protectedPxHeightFieldDesc(long address) -
Method Summary
Modifier and TypeMethodDescriptionstatic PxHeightFieldDescarrayGet(long baseAddress, int index) static PxHeightFieldDesccreateAt(long address) static <T> PxHeightFieldDesccreateAt(T allocator, NativeObject.Allocator<T> allocate) voiddestroy()floatThis threshold is used by the collision detection to determine if a height field edge is convex and can generate contact points.getFlags()Flags bits, combined from values of the enum ::PxHeightFieldFlag.Format of the sample data.intNumber of sample columns in the height field samples array.intNumber of sample rows in the height field samples array.The samples array.booleanisValid()Returns true if the descriptor is valid.voidsetConvexEdgeThreshold(float value) This threshold is used by the collision detection to determine if a height field edge is convex and can generate contact points.voidsetFlags(PxHeightFieldFlags value) Flags bits, combined from values of the enum ::PxHeightFieldFlag.voidsetFormat(PxHeightFieldFormatEnum value) Format of the sample data.voidsetNbColumns(int value) Number of sample columns in the height field samples array.voidsetNbRows(int value) Number of sample rows in the height field samples array.voidsetSamples(PxStridedData value) The samples array.void(re)sets the structure to the default.static PxHeightFieldDescwrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxHeightFieldDesc
protected PxHeightFieldDesc(long address) -
PxHeightFieldDesc
public PxHeightFieldDesc()Constructor sets to default.
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.- Returns:
- Stack allocated object of PxHeightFieldDesc
-
createAt
- Type Parameters:
T- Allocator class, e.g. LWJGL's MemoryStack.- Parameters:
allocator- Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.allocate- Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.- Returns:
- Stack allocated object of PxHeightFieldDesc
-
destroy
public void destroy() -
getNbRows
public int getNbRows()Number of sample rows in the height field samples array.Note: Local space X-axis corresponds to rows.
Range: >1
Default: 0 -
setNbRows
public void setNbRows(int value) Number of sample rows in the height field samples array.Note: Local space X-axis corresponds to rows.
Range: >1
Default: 0 -
getNbColumns
public int getNbColumns()Number of sample columns in the height field samples array.Note: Local space Z-axis corresponds to columns.
Range: >1
Default: 0 -
setNbColumns
public void setNbColumns(int value) Number of sample columns in the height field samples array.Note: Local space Z-axis corresponds to columns.
Range: >1
Default: 0 -
getFormat
Format of the sample data.Currently the only supported format is PxHeightFieldFormat::eS16_TM:
Default: PxHeightFieldFormat::eS16_TM
-
setFormat
Format of the sample data.Currently the only supported format is PxHeightFieldFormat::eS16_TM:
Default: PxHeightFieldFormat::eS16_TM
-
getSamples
The samples array.It is copied to the SDK's storage at creation time.
There are nbRows * nbColumn samples in the array, which define nbRows * nbColumn vertices and cells, of which (nbRows - 1) * (nbColumns - 1) cells are actually used.
The array index of sample(row, column) = row * nbColumns + column. The byte offset of sample(row, column) = sampleStride * (row * nbColumns + column). The sample data follows at the offset and spans the number of bytes defined by the format. Then there are zero or more unused bytes depending on sampleStride before the next sample.
Default: NULL
-
setSamples
The samples array.It is copied to the SDK's storage at creation time.
There are nbRows * nbColumn samples in the array, which define nbRows * nbColumn vertices and cells, of which (nbRows - 1) * (nbColumns - 1) cells are actually used.
The array index of sample(row, column) = row * nbColumns + column. The byte offset of sample(row, column) = sampleStride * (row * nbColumns + column). The sample data follows at the offset and spans the number of bytes defined by the format. Then there are zero or more unused bytes depending on sampleStride before the next sample.
Default: NULL
-
getConvexEdgeThreshold
public float getConvexEdgeThreshold()This threshold is used by the collision detection to determine if a height field edge is convex and can generate contact points. Usually the convexity of an edge is determined from the angle (or cosine of the angle) between the normals of the faces sharing that edge. The height field allows a more efficient approach by comparing height values of neighboring vertices. This parameter offsets the comparison. Smaller changes than 0.5 will not alter the set of convex edges. The rule of thumb is that larger values will result in fewer edge contacts.This parameter is ignored in contact generation with sphere and capsule primitives.
Range: [0, PX_MAX_F32)
Default: 0 -
setConvexEdgeThreshold
public void setConvexEdgeThreshold(float value) This threshold is used by the collision detection to determine if a height field edge is convex and can generate contact points. Usually the convexity of an edge is determined from the angle (or cosine of the angle) between the normals of the faces sharing that edge. The height field allows a more efficient approach by comparing height values of neighboring vertices. This parameter offsets the comparison. Smaller changes than 0.5 will not alter the set of convex edges. The rule of thumb is that larger values will result in fewer edge contacts.This parameter is ignored in contact generation with sphere and capsule primitives.
Range: [0, PX_MAX_F32)
Default: 0 -
getFlags
Flags bits, combined from values of the enum ::PxHeightFieldFlag.Default: 0
- See Also:
-
setFlags
Flags bits, combined from values of the enum ::PxHeightFieldFlag.Default: 0
- See Also:
-
setToDefault
public void setToDefault()(re)sets the structure to the default. -
isValid
public boolean isValid()Returns true if the descriptor is valid.- Returns:
- True if the current settings are valid.
-