This format corresponds to the #PxHeightFieldFormat member PxHeightFieldFormat::eS16_TM.
An array of heightfield samples are used when creating a PxHeightField to specify the elevation of the heightfield points. In addition the material and tessellation of the adjacent triangles are specified.
- 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxHeightFieldSamplearrayGet(long baseAddress, int index) voidstatic PxHeightFieldSamplecreateAt(long address) static <T> PxHeightFieldSamplecreateAt(T allocator, NativeObject.Allocator<T> allocate) voiddestroy()shortThe height of the heightfield samplebyteThe triangle material index of the quad's lower triangle + tesselation flagbyteThe triangle material index of the quad's upper triangle + reserved flagvoidsetHeight(short value) The height of the heightfield samplevoidsetMaterialIndex0(byte value) The triangle material index of the quad's lower triangle + tesselation flagvoidsetMaterialIndex1(byte value) The triangle material index of the quad's upper triangle + reserved flagvoidbytetessFlag()static PxHeightFieldSamplewrapPointer(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
-
PxHeightFieldSample
protected PxHeightFieldSample(long address) -
PxHeightFieldSample
public PxHeightFieldSample()
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.- Returns:
- Stack allocated object of PxHeightFieldSample
-
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 PxHeightFieldSample
-
destroy
public void destroy() -
getHeight
public short getHeight()The height of the heightfield sampleThis value is scaled by PxHeightFieldGeometry::heightScale.
- See Also:
-
setHeight
public void setHeight(short value) The height of the heightfield sampleThis value is scaled by PxHeightFieldGeometry::heightScale.
- See Also:
-
getMaterialIndex0
public byte getMaterialIndex0()The triangle material index of the quad's lower triangle + tesselation flagAn index pointing into the material table of the shape which instantiates the heightfield. This index determines the material of the lower of the quad's two triangles (i.e. the quad whose upper-left corner is this sample, see the Guide for illustrations).
Special values of the 7 data bits are defined by PxHeightFieldMaterial
The tesselation flag specifies which way the quad is split whose upper left corner is this sample. If the flag is set, the diagonal of the quad will run from this sample to the opposite vertex; if not, it will run between the other two vertices (see the Guide for illustrations).
-
setMaterialIndex0
public void setMaterialIndex0(byte value) The triangle material index of the quad's lower triangle + tesselation flagAn index pointing into the material table of the shape which instantiates the heightfield. This index determines the material of the lower of the quad's two triangles (i.e. the quad whose upper-left corner is this sample, see the Guide for illustrations).
Special values of the 7 data bits are defined by PxHeightFieldMaterial
The tesselation flag specifies which way the quad is split whose upper left corner is this sample. If the flag is set, the diagonal of the quad will run from this sample to the opposite vertex; if not, it will run between the other two vertices (see the Guide for illustrations).
-
getMaterialIndex1
public byte getMaterialIndex1()The triangle material index of the quad's upper triangle + reserved flagAn index pointing into the material table of the shape which instantiates the heightfield. This index determines the material of the upper of the quad's two triangles (i.e. the quad whose upper-left corner is this sample, see the Guide for illustrations).
-
setMaterialIndex1
public void setMaterialIndex1(byte value) The triangle material index of the quad's upper triangle + reserved flagAn index pointing into the material table of the shape which instantiates the heightfield. This index determines the material of the upper of the quad's two triangles (i.e. the quad whose upper-left corner is this sample, see the Guide for illustrations).
-
tessFlag
public byte tessFlag()- Returns:
- WebIDL type: octet
-
clearTessFlag
public void clearTessFlag() -
setTessFlag
public void setTessFlag()
-