public class MeshCollisionShape extends CollisionShape
btBvhTriangleMeshShape. Not for use in dynamic bodies.
Collisions between HeightfieldCollisionShape,
MeshCollisionShape, and PlaneCollisionShape objects are never
detected.
TODO add a shape based on btScaledBvhTriangleMeshShape
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
static int |
maxSubmeshes
maximum number of submeshes when compression is used
|
static int |
maxTrianglesInAnySubmesh
maximum number of triangles in any submesh when compression is used
|
enableContactFilter, logger, margin, scaleloggerN| Constructor and Description |
|---|
MeshCollisionShape(boolean useCompression,
java.util.Collection<IndexedMesh> meshes)
Instantiate a shape from the specified collection of native meshes.
|
MeshCollisionShape(boolean useCompression,
CompoundMesh mesh)
Instantiate a shape based on the specified CompoundMesh.
|
MeshCollisionShape(boolean useCompression,
IndexedMesh... submeshes)
Instantiate a shape from the specified native mesh(es).
|
MeshCollisionShape(byte[] bvhBytes,
IndexedMesh... submeshes)
Instantiate a shape from the specified native mesh(es) and serialized
BVH.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSplit()
Test whether this shape can be split by an arbitrary plane.
|
int |
countMeshTriangles()
Count how many triangles are in the mesh.
|
int |
countMeshVertices()
Count how many vertices are in the mesh.
|
int |
countSubmeshes()
Count how many submeshes are in the mesh.
|
BoundingValueHierarchy |
getBvh()
Access the bounding-value hierarchy.
|
IndexedMesh |
getSubmesh(int index)
Access the specified submesh.
|
protected void |
recalculateAabb()
Recalculate this shape's bounding box if necessary.
|
byte[] |
serializeBvh()
Serialize the BVH to a byte array.
|
void |
setScale(Vector3f scale)
Alter the scale of this shape.
|
MeshCollisionShape[] |
split(Triangle splittingTriangle)
Attempt to divide this shape into 2 shapes.
|
aabbCenter, boundingBox, boundingBox, canScale, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isConcave, isContactFilterEnabled, isConvex, isInfinite, isNonMoving, isPolyhedral, maxRadius, nativeMargin, scaledVolume, setContactFilterEnabled, setDefaultMargin, setMargin, setNativeId, setScale, setUserIndex, setUserIndex2, toSplittableShape, toString, updateScale, userIndex, userIndex2compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final int maxSubmeshes
public static final int maxTrianglesInAnySubmesh
public static final java.util.logging.Logger logger2
public MeshCollisionShape(boolean useCompression,
java.util.Collection<IndexedMesh> meshes)
useCompression - true to use quantized AABB compressionmeshes - the collection on which to base the shape (must contain at
least one triangle)public MeshCollisionShape(boolean useCompression,
CompoundMesh mesh)
useCompression - true to use quantized AABB compressionmesh - the mesh on which to base the shape (not null, must contain
at least one triangle, unaffected)public MeshCollisionShape(boolean useCompression,
IndexedMesh... submeshes)
useCompression - true to use quantized AABB compressionsubmeshes - the mesh(es) on which to base the shape (must contain at
least one triangle)public MeshCollisionShape(byte[] bvhBytes,
IndexedMesh... submeshes)
bvhBytes - the serialized BVH (not null, unaffected)submeshes - the mesh(es) on which to base the shape (must contain at
least one triangle)public int countMeshTriangles()
public int countMeshVertices()
public int countSubmeshes()
public BoundingValueHierarchy getBvh()
public IndexedMesh getSubmesh(int index)
index - the index of the desired submesh (in the order the submeshes
were added, ≥0)public byte[] serializeBvh()
public MeshCollisionShape[] split(Triangle splittingTriangle)
splittingTriangle - to define the splitting plane (in shape
coordinates, not null, unaffected)public boolean canSplit()
canSplit in class CollisionShapeprotected void recalculateAabb()
recalculateAabb in class CollisionShapepublic void setScale(Vector3f scale)
Note that if shapes are shared (between collision objects and/or compound shapes) changes can have unintended consequences.
setScale in class CollisionShapescale - the desired scale factor for each local axis (not null, no
negative component, unaffected, default=(1,1,1))