com.bulletphysics.collision.shapes
Class OptimizedBvh
java.lang.Object
com.bulletphysics.collision.shapes.OptimizedBvh
public class OptimizedBvh
- extends java.lang.Object
OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU,GPU in future).
Method Summary |
void |
assignInternalNodeFromLeafNode(int internalNode,
int leafNodeIndex)
|
void |
build(StridingMeshInterface triangles,
boolean useQuantizedAabbCompression,
javax.vecmath.Vector3f _aabbMin,
javax.vecmath.Vector3f _aabbMax)
|
protected void |
buildTree(int startIndex,
int endIndex)
|
protected int |
calcSplittingAxis(int startIndex,
int endIndex)
|
javax.vecmath.Vector3f |
getAabbMax(int nodeIndex)
|
javax.vecmath.Vector3f |
getAabbMin(int nodeIndex)
|
void |
mergeInternalNodeAabb(int nodeIndex,
javax.vecmath.Vector3f newAabbMin,
javax.vecmath.Vector3f newAabbMax)
|
long |
quantizeWithClamp(javax.vecmath.Vector3f point)
|
void |
refit(StridingMeshInterface meshInterface)
|
void |
refitPartial(StridingMeshInterface meshInterface,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
|
void |
reportAabbOverlappingNodex(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
|
void |
reportBoxCastOverlappingNodex(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f raySource,
javax.vecmath.Vector3f rayTarget,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
|
void |
reportRayOverlappingNodex(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f raySource,
javax.vecmath.Vector3f rayTarget)
|
void |
setInternalNodeAabbMax(int nodeIndex,
javax.vecmath.Vector3f aabbMax)
|
void |
setInternalNodeAabbMin(int nodeIndex,
javax.vecmath.Vector3f aabbMin)
|
void |
setInternalNodeEscapeIndex(int nodeIndex,
int escapeIndex)
|
void |
setQuantizationValues(javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
|
void |
setQuantizationValues(javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax,
float quantizationMargin)
|
protected int |
sortAndCalcSplittingIndex(int startIndex,
int endIndex,
int splitAxis)
|
void |
swapLeafNodes(int i,
int splitIndex)
|
protected boolean |
testQuantizedAabbAgainstQuantizedAabb(long aabbMin1,
long aabbMax1,
long aabbMin2,
long aabbMax2)
|
void |
unQuantize(javax.vecmath.Vector3f vecOut,
long vecIn)
|
void |
updateBvhNodes(StridingMeshInterface meshInterface,
int firstNode,
int endNode,
int index)
|
protected void |
updateSubtreeHeaders(int leftChildNodexIndex,
int rightChildNodexIndex)
|
protected void |
walkRecursiveQuantizedTreeAgainstQueryAabb(QuantizedBvhNodes currentNodes,
int currentNodeId,
NodeOverlapCallback nodeCallback,
long quantizedQueryAabbMin,
long quantizedQueryAabbMax)
|
protected void |
walkStacklessTree(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_SUBTREE_SIZE_IN_BYTES
public static final int MAX_SUBTREE_SIZE_IN_BYTES
- See Also:
- Constant Field Values
MAX_NUM_PARTS_IN_BITS
public static final int MAX_NUM_PARTS_IN_BITS
- See Also:
- Constant Field Values
traversalMode
protected TraversalMode traversalMode
SubtreeHeaders
protected final java.util.List<BvhSubtreeInfo> SubtreeHeaders
subtreeHeaderCount
protected int subtreeHeaderCount
OptimizedBvh
public OptimizedBvh()
setInternalNodeAabbMin
public void setInternalNodeAabbMin(int nodeIndex,
javax.vecmath.Vector3f aabbMin)
setInternalNodeAabbMax
public void setInternalNodeAabbMax(int nodeIndex,
javax.vecmath.Vector3f aabbMax)
getAabbMin
public javax.vecmath.Vector3f getAabbMin(int nodeIndex)
getAabbMax
public javax.vecmath.Vector3f getAabbMax(int nodeIndex)
setQuantizationValues
public void setQuantizationValues(javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
setQuantizationValues
public void setQuantizationValues(javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax,
float quantizationMargin)
setInternalNodeEscapeIndex
public void setInternalNodeEscapeIndex(int nodeIndex,
int escapeIndex)
mergeInternalNodeAabb
public void mergeInternalNodeAabb(int nodeIndex,
javax.vecmath.Vector3f newAabbMin,
javax.vecmath.Vector3f newAabbMax)
swapLeafNodes
public void swapLeafNodes(int i,
int splitIndex)
assignInternalNodeFromLeafNode
public void assignInternalNodeFromLeafNode(int internalNode,
int leafNodeIndex)
build
public void build(StridingMeshInterface triangles,
boolean useQuantizedAabbCompression,
javax.vecmath.Vector3f _aabbMin,
javax.vecmath.Vector3f _aabbMax)
refit
public void refit(StridingMeshInterface meshInterface)
refitPartial
public void refitPartial(StridingMeshInterface meshInterface,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
updateBvhNodes
public void updateBvhNodes(StridingMeshInterface meshInterface,
int firstNode,
int endNode,
int index)
buildTree
protected void buildTree(int startIndex,
int endIndex)
testQuantizedAabbAgainstQuantizedAabb
protected boolean testQuantizedAabbAgainstQuantizedAabb(long aabbMin1,
long aabbMax1,
long aabbMin2,
long aabbMax2)
updateSubtreeHeaders
protected void updateSubtreeHeaders(int leftChildNodexIndex,
int rightChildNodexIndex)
sortAndCalcSplittingIndex
protected int sortAndCalcSplittingIndex(int startIndex,
int endIndex,
int splitAxis)
calcSplittingAxis
protected int calcSplittingAxis(int startIndex,
int endIndex)
reportAabbOverlappingNodex
public void reportAabbOverlappingNodex(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
walkStacklessTree
protected void walkStacklessTree(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
walkRecursiveQuantizedTreeAgainstQueryAabb
protected void walkRecursiveQuantizedTreeAgainstQueryAabb(QuantizedBvhNodes currentNodes,
int currentNodeId,
NodeOverlapCallback nodeCallback,
long quantizedQueryAabbMin,
long quantizedQueryAabbMax)
reportRayOverlappingNodex
public void reportRayOverlappingNodex(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f raySource,
javax.vecmath.Vector3f rayTarget)
reportBoxCastOverlappingNodex
public void reportBoxCastOverlappingNodex(NodeOverlapCallback nodeCallback,
javax.vecmath.Vector3f raySource,
javax.vecmath.Vector3f rayTarget,
javax.vecmath.Vector3f aabbMin,
javax.vecmath.Vector3f aabbMax)
quantizeWithClamp
public long quantizeWithClamp(javax.vecmath.Vector3f point)
unQuantize
public void unQuantize(javax.vecmath.Vector3f vecOut,
long vecIn)