public class MeshCollisionShape extends CollisionShape
| Modifier and Type | Field and Description |
|---|---|
protected long |
meshId |
protected long |
nativeBVHBuffer |
protected int |
numTriangles |
protected int |
numVertices |
protected java.nio.ByteBuffer |
triangleIndexBase |
protected int |
triangleIndexStride |
protected java.nio.ByteBuffer |
vertexBase |
protected int |
vertexStride |
margin, objectId, scale| Constructor and Description |
|---|
MeshCollisionShape() |
MeshCollisionShape(java.nio.ByteBuffer indices,
java.nio.ByteBuffer vertices,
boolean memoryOptimized)
Advanced constructor, usually you don’t want to use this, but the Mesh
based one.
|
MeshCollisionShape(com.jme3.scene.Mesh mesh)
Creates a collision shape from the given Mesh.
|
MeshCollisionShape(com.jme3.scene.Mesh mesh,
boolean memoryOptimized)
Creates a collision shape from the given Mesh.
|
| Modifier and Type | Method and Description |
|---|---|
void |
finalize() |
void |
read(com.jme3.export.JmeImporter im) |
void |
write(com.jme3.export.JmeExporter ex) |
getMargin, getObjectId, getScale, setMargin, setObjectId, setScaleprotected int numVertices
protected int numTriangles
protected int vertexStride
protected int triangleIndexStride
protected java.nio.ByteBuffer triangleIndexBase
protected java.nio.ByteBuffer vertexBase
protected long meshId
protected long nativeBVHBuffer
public MeshCollisionShape()
public MeshCollisionShape(com.jme3.scene.Mesh mesh)
mesh - public MeshCollisionShape(com.jme3.scene.Mesh mesh,
boolean memoryOptimized)
memoryOptimized determines if optimized instead of
quantized BVH will be used.
Internally, memoryOptimized BVH is slower to calculate (~4x)
but also smaller (~0.5x).
It is preferable to use the memory optimized version and then serialize
the resulting MeshCollisionshape as this will also save the
generated BVH.
An exception can be procedurally / generated collision shapes, where
the generation time is more of a concernmesh - the Mesh to usememoryOptimized - True to generate a memory optimized BVH,
false to generate quantized BVH.public MeshCollisionShape(java.nio.ByteBuffer indices,
java.nio.ByteBuffer vertices,
boolean memoryOptimized)
indices - the raw index buffervertices - the raw vertex buffermemoryOptimized - use quantisize BVH, uses less memory, but slowerpublic void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablewrite in class CollisionShapejava.io.IOExceptionpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savableread in class CollisionShapejava.io.IOExceptionpublic void finalize()
throws java.lang.Throwable
finalize in class CollisionShapejava.lang.Throwable