public class HeightfieldCollisionShape extends CollisionShape
btHeightfieldTerrainShape. Should be more efficient than an
equivalent MeshCollisionShape. Not for use in dynamic bodies.
Collisions between HeightfieldCollisionShape,
MeshCollisionShape, and PlaneCollisionShape objects are never
detected.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
enableContactFilter, logger, margin, scaleloggerN| Constructor and Description |
|---|
HeightfieldCollisionShape(float[] heightmap)
Instantiate a square shape for the specified height map.
|
HeightfieldCollisionShape(float[] heightmap,
Vector3f scale)
Instantiate a square shape for the specified height map and scale vector.
|
HeightfieldCollisionShape(int stickLength,
int stickWidth,
float[] heightmap,
Vector3f scale,
int upAxis,
boolean flipQuadEdges,
boolean flipTriangleWinding,
boolean useDiamond,
boolean useZigzag)
Instantiate a rectangular shape for the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countColumns()
Count how many columns are in the heightfield.
|
int |
countMeshVertices()
Count how many data points are in the heightfield.
|
int |
countRows()
Count how many rows are in the heightfield.
|
CollisionShape |
toSplittableShape()
Approximate this shape with a splittable shape.
|
int |
upAxis()
Return the index of the height axis.
|
aabbCenter, boundingBox, boundingBox, canScale, canSplit, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isConcave, isContactFilterEnabled, isConvex, isInfinite, isNonMoving, isPolyhedral, maxRadius, nativeMargin, recalculateAabb, scaledVolume, setContactFilterEnabled, setDefaultMargin, setMargin, setNativeId, setScale, setScale, setUserIndex, setUserIndex2, toString, updateScale, userIndex, userIndex2compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final java.util.logging.Logger logger2
public HeightfieldCollisionShape(float[] heightmap)
heightmap - (not null, length≥4, length a perfect square,
unaffected)public HeightfieldCollisionShape(float[] heightmap,
Vector3f scale)
heightmap - (not null, length≥4, length a perfect square,
unaffected)scale - the desired scale factor for each local axis (not null, no
negative component, unaffected, default=(1,1,1))public HeightfieldCollisionShape(int stickLength,
int stickWidth,
float[] heightmap,
Vector3f scale,
int upAxis,
boolean flipQuadEdges,
boolean flipTriangleWinding,
boolean useDiamond,
boolean useZigzag)
stickLength - the number of rows in the heightfield (>1)stickWidth - number of columns in the heightfield (>1)heightmap - (not null, length≥stickLength*stickWidth, unaffected)scale - the desired scale factor for each local axis (not null, no
negative component, unaffected, default=(1,1,1))upAxis - the height-axis index (0→X, 1→Y, 2→Z,
default=1)flipQuadEdges - true→reverse the direction of the first
diagonal (default=true)flipTriangleWinding - true→left-hand winding of triangles
(default=false)useDiamond - true→diagonals alternate on both horizontal axes
(default=false)useZigzag - true→diagonals alternate on one horizontal axis
(default=false)public int countColumns()
public int countMeshVertices()
public int countRows()
public int upAxis()
public CollisionShape toSplittableShape()
toSplittableShape in class CollisionShape