java.lang.Object
physx.NativeObject
physx.geometry.PxGeometry
physx.geometry.PxHeightFieldGeometry
Height field geometry class.
This class allows to create a scaled height field geometry instance.
There is a minimum allowed value for Y and XZ scaling - PX_MIN_HEIGHTFIELD_XZ_SCALE, heightfield creation will fail if XZ value is below this value.
-
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.protectedPxHeightFieldGeometry(long address) PxHeightFieldGeometry(PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic PxHeightFieldGeometryarrayGet(long baseAddress, int index) static PxHeightFieldGeometrycreateAt(long address) static PxHeightFieldGeometrycreateAt(long address, PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale) static <T> PxHeightFieldGeometrycreateAt(T allocator, NativeObject.Allocator<T> allocate) static <T> PxHeightFieldGeometrycreateAt(T allocator, NativeObject.Allocator<T> allocate, PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale) voiddestroy()floatThe scaling factor for the height field in the column direction (z direction in local space).The height field data.Flags to specify some collision properties for the height field.floatThe scaling factor for the height field in vertical direction (y direction in local space).floatThe scaling factor for the height field in the row direction (x direction in local space).booleanisValid()Returns true if the geometry is valid.voidsetColumnScale(float value) The scaling factor for the height field in the column direction (z direction in local space).voidsetHeightField(PxHeightField value) The height field data.voidFlags to specify some collision properties for the height field.voidsetHeightScale(float value) The scaling factor for the height field in vertical direction (y direction in local space).voidsetRowScale(float value) The scaling factor for the height field in the row direction (x direction in local space).static PxHeightFieldGeometrywrapPointer(long address) Methods inherited from class physx.geometry.PxGeometry
getTypeMethods 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
-
PxHeightFieldGeometry
protected PxHeightFieldGeometry(long address) -
PxHeightFieldGeometry
public PxHeightFieldGeometry()Constructor. -
PxHeightFieldGeometry
public PxHeightFieldGeometry(PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale) Constructor.
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.- Returns:
- Stack allocated object of PxHeightFieldGeometry
-
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 PxHeightFieldGeometry
-
createAt
public static PxHeightFieldGeometry createAt(long address, PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale) - Parameters:
address- Pre-allocated memory, where the object is created.hf- WebIDL type:PxHeightFieldflags- WebIDL type:PxMeshGeometryFlags[Ref]heightScale- WebIDL type: floatrowScale- WebIDL type: floatcolumnScale- WebIDL type: float- Returns:
- Stack allocated object of PxHeightFieldGeometry
-
createAt
public static <T> PxHeightFieldGeometry createAt(T allocator, NativeObject.Allocator<T> allocate, PxHeightField hf, PxMeshGeometryFlags flags, float heightScale, float rowScale, float columnScale) - 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.hf- WebIDL type:PxHeightFieldflags- WebIDL type:PxMeshGeometryFlags[Ref]heightScale- WebIDL type: floatrowScale- WebIDL type: floatcolumnScale- WebIDL type: float- Returns:
- Stack allocated object of PxHeightFieldGeometry
-
destroy
public void destroy()- Overrides:
destroyin classPxGeometry
-
getHeightField
The height field data. -
setHeightField
The height field data. -
getHeightScale
public float getHeightScale()The scaling factor for the height field in vertical direction (y direction in local space). -
setHeightScale
public void setHeightScale(float value) The scaling factor for the height field in vertical direction (y direction in local space). -
getRowScale
public float getRowScale()The scaling factor for the height field in the row direction (x direction in local space). -
setRowScale
public void setRowScale(float value) The scaling factor for the height field in the row direction (x direction in local space). -
getColumnScale
public float getColumnScale()The scaling factor for the height field in the column direction (z direction in local space). -
setColumnScale
public void setColumnScale(float value) The scaling factor for the height field in the column direction (z direction in local space). -
getHeightFieldFlags
Flags to specify some collision properties for the height field. -
setHeightFieldFlags
Flags to specify some collision properties for the height field. -
isValid
public boolean isValid()Returns true if the geometry is valid.- Returns:
- True if the current settings are valid
Note: A valid height field has a positive scale value in each direction (heightScale > 0, rowScale > 0, columnScale > 0). It is illegal to call PxRigidActor::createShape and PxPhysics::createShape with a height field that has zero extents in any direction.
-