public class IndexedMesh extends NativePhysicsObject
btIndexedMesh. Immutable.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
loggerN| Constructor and Description |
|---|
IndexedMesh(CollisionShape shape,
int meshResolution)
Instantiate a IndexedMesh to visualize the specified collision shape.
|
IndexedMesh(java.nio.FloatBuffer buffer)
Instantiate an IndexedMesh based on the specified vertex positions.
|
IndexedMesh(java.nio.FloatBuffer positionBuffer,
java.nio.IntBuffer indexBuffer)
Instantiate an IndexedMesh based on the specified positions and indices.
|
IndexedMesh(Vector3f[] positionArray,
int[] indexArray)
Instantiate an IndexedMesh based on the specified positions and indices.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.IntBuffer |
copyIndices()
Copy the triangle indices.
|
void |
copyTriangle(int triangleIndex,
Triangle destination)
Copy the vertex positions of the specified triangle.
|
java.nio.FloatBuffer |
copyTriangles()
Copy the unindexed triangle vertices to a new buffer.
|
java.nio.FloatBuffer |
copyVertexPositions()
Copy the vertex positions to a new buffer.
|
int |
countTriangles()
Count how many triangles are in this mesh.
|
int |
countVertices()
Count how many vertices are in this mesh.
|
float |
maxDistance(Transform meshToWorld)
Calculate how far the mesh extends from some origin.
|
void |
maxMin(Vector3f storeMaxima,
Vector3f storeMinima)
Find the maximum and minimum coordinates for each axis among the vertices
in this mesh.
|
IndexedMesh[] |
split(Plane splittingPlane)
Attempt to divide this mesh into 2 meshes.
|
float |
surfaceArea()
Calculate the (one-sided) surface area of the mesh.
|
float |
volumeConvex()
Calculate volume of the mesh, assuming it's both closed and convex.
|
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObjectpublic static final java.util.logging.Logger logger
public IndexedMesh(Vector3f[] positionArray, int[] indexArray)
positionArray - (not null, unaffected)indexArray - (not null, unaffected, length a multiple of 3)public IndexedMesh(java.nio.FloatBuffer buffer)
buffer - the vertex positions of a non-indexed triangle mesh (not
null, flipped, limit a multiple of 9, unaffected)public IndexedMesh(java.nio.FloatBuffer positionBuffer,
java.nio.IntBuffer indexBuffer)
positionBuffer - (not null, not flipped, length a multiple of 3,
alias created)indexBuffer - (not null, not flipped, length a multiple of 3, alias
created)public IndexedMesh(CollisionShape shape, int meshResolution)
shape - shape to visualize (not null, not compound, unaffected)meshResolution - 0→low, 1→high for convex shapes,
2→high for all shapespublic java.nio.IntBuffer copyIndices()
public void copyTriangle(int triangleIndex,
Triangle destination)
triangleIndex - the index of the source triangle (≥0)destination - storage for the result (not null, modified)public java.nio.FloatBuffer copyTriangles()
public java.nio.FloatBuffer copyVertexPositions()
public int countTriangles()
public int countVertices()
public float maxDistance(Transform meshToWorld)
meshToWorld - the transform to apply to vertex locations (not null,
unaffected)public void maxMin(Vector3f storeMaxima, Vector3f storeMinima)
storeMaxima - storage for the maxima (not null, modified)storeMinima - storage for the minima (not null, modified)public IndexedMesh[] split(Plane splittingPlane)
splittingPlane - the splitting plane (not null, unaffected)public float surfaceArea()
public float volumeConvex()