public class BoundingValueHierarchy extends NativePhysicsObject
btOptimizedBvh.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
loggerN| Constructor and Description |
|---|
BoundingValueHierarchy(byte[] bytes)
Instantiate a (tracked) hierarchy from serialized bytes.
|
BoundingValueHierarchy(MeshCollisionShape meshShape)
Instantiate an (untracked) reference to the hierarchy of the specified
MeshCollisionShape. |
| Modifier and Type | Method and Description |
|---|---|
BoundingBox |
copyAabb(BoundingBox storeResult)
Copy the bounds of the hierarchy.
|
Vector3f |
copyQuantization(Vector3f storeResult)
Copy the quantization vector of the hierarchy.
|
int |
countLeafNodes()
Count the leaf nodes in the hierarchy.
|
int |
countNodes()
Count all nodes in the hierarchy.
|
int |
countSubtreeHeaders()
Count the subtree headers in the hierarchy (native field:
m_SubtreeHeaders).
|
int |
escapeIndex(int nodeIndex)
Return the escape index of the specified node.
|
boolean |
isCompressed()
Test whether the hierarchy uses quantized AABB compression.
|
boolean |
isLeafNode(int nodeIndex)
Test whether the specified node is a leaf.
|
int |
partId(int nodeIndex)
Return the part index of the specified node.
|
byte[] |
serialize()
Serialize the hierarchy to a byte array.
|
void |
setTraversalMode(int mode)
Alter the traversal mode (native field: m_traversalMode).
|
int |
traversalMode()
Return the traversal mode (native field: m_traversalMode).
|
int |
triangleIndex(int nodeIndex)
Return the triangle index of the specified node.
|
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObjectpublic static final java.util.logging.Logger logger
public BoundingValueHierarchy(MeshCollisionShape meshShape)
MeshCollisionShape.meshShape - the pre-existing shape (not null)public BoundingValueHierarchy(byte[] bytes)
If the bytes weren't generated on the current Platform with the
same floating-point precision, the results are undefined (likely a JVM
crash).
bytes - the serialized bytes (not null, unaffected)public BoundingBox copyAabb(BoundingBox storeResult)
storeResult - storage for the result (modified if not null)storeResult or a new
instance)public Vector3f copyQuantization(Vector3f storeResult)
storeResult - storage for the result (modified if not null)storeResult or a new vector)public int countLeafNodes()
public int countNodes()
public int countSubtreeHeaders()
public int escapeIndex(int nodeIndex)
nodeIndex - the index of the node (≥0)public boolean isCompressed()
public boolean isLeafNode(int nodeIndex)
nodeIndex - the index of the node (≥0)public int partId(int nodeIndex)
nodeIndex - the index of the node (≥0)public byte[] serialize()
Serialization can be used to avoid re-generating the BVH of a
`MeshCollisionShape` each time it is instantiated. The resulting bytes
are specific to a particular `MeshCollisionShape`. They are also specific
to the current Platform and floating-point precision.
public void setTraversalMode(int mode)
mode - 0 for "stackless" or 1 for "stackless cache-friendly" or 2
for "recursive" (default=0)public int traversalMode()
public int triangleIndex(int nodeIndex)
nodeIndex - the index of the node (≥0)