com.bulletphysics.collision.shapes
Class OptimizedBvh

java.lang.Object
  extended by com.bulletphysics.collision.shapes.OptimizedBvh
All Implemented Interfaces:
Serializable

public class OptimizedBvh
extends Object
implements Serializable

OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU, GPU in future).

See Also:
Serialized Form

Field Summary
static int MAX_NUM_PARTS_IN_BITS
           
static int MAX_SUBTREE_SIZE_IN_BYTES
           
 
Constructor Summary
OptimizedBvh()
           
 
Method Summary
 void assignInternalNodeFromLeafNode(int internalNode, int leafNodeIndex)
           
 void build(StridingMeshInterface triangles, boolean useQuantizedAabbCompression, Vector3f _aabbMin, Vector3f _aabbMax)
           
 Vector3f getAabbMax(int nodeIndex)
           
 Vector3f getAabbMin(int nodeIndex)
           
 void mergeInternalNodeAabb(int nodeIndex, Vector3f newAabbMin, Vector3f newAabbMax)
           
 long quantizeWithClamp(Vector3f point)
           
 void refit(StridingMeshInterface meshInterface)
           
 void refitPartial(StridingMeshInterface meshInterface, Vector3f aabbMin, Vector3f aabbMax)
           
 void reportAabbOverlappingNodex(NodeOverlapCallback nodeCallback, Vector3f aabbMin, Vector3f aabbMax)
           
 void reportBoxCastOverlappingNodex(NodeOverlapCallback nodeCallback, Vector3f raySource, Vector3f rayTarget, Vector3f aabbMin, Vector3f aabbMax)
           
 void reportRayOverlappingNodex(NodeOverlapCallback nodeCallback, Vector3f raySource, Vector3f rayTarget)
           
 void setInternalNodeAabbMax(int nodeIndex, Vector3f aabbMax)
           
 void setInternalNodeAabbMin(int nodeIndex, Vector3f aabbMin)
           
 void setInternalNodeEscapeIndex(int nodeIndex, int escapeIndex)
           
 void setQuantizationValues(Vector3f aabbMin, Vector3f aabbMax)
           
 void setQuantizationValues(Vector3f aabbMin, Vector3f aabbMax, float quantizationMargin)
           
 void swapLeafNodes(int i, int splitIndex)
           
 void unQuantize(Vector3f vecOut, long vecIn)
           
 void updateBvhNodes(StridingMeshInterface meshInterface, int firstNode, int endNode, int index)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

OptimizedBvh

public OptimizedBvh()
Method Detail

setInternalNodeAabbMin

public void setInternalNodeAabbMin(int nodeIndex,
                                   Vector3f aabbMin)

setInternalNodeAabbMax

public void setInternalNodeAabbMax(int nodeIndex,
                                   Vector3f aabbMax)

getAabbMin

public Vector3f getAabbMin(int nodeIndex)

getAabbMax

public Vector3f getAabbMax(int nodeIndex)

setQuantizationValues

public void setQuantizationValues(Vector3f aabbMin,
                                  Vector3f aabbMax)

setQuantizationValues

public void setQuantizationValues(Vector3f aabbMin,
                                  Vector3f aabbMax,
                                  float quantizationMargin)

setInternalNodeEscapeIndex

public void setInternalNodeEscapeIndex(int nodeIndex,
                                       int escapeIndex)

mergeInternalNodeAabb

public void mergeInternalNodeAabb(int nodeIndex,
                                  Vector3f newAabbMin,
                                  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,
                  Vector3f _aabbMin,
                  Vector3f _aabbMax)

refit

public void refit(StridingMeshInterface meshInterface)

refitPartial

public void refitPartial(StridingMeshInterface meshInterface,
                         Vector3f aabbMin,
                         Vector3f aabbMax)

updateBvhNodes

public void updateBvhNodes(StridingMeshInterface meshInterface,
                           int firstNode,
                           int endNode,
                           int index)

reportAabbOverlappingNodex

public void reportAabbOverlappingNodex(NodeOverlapCallback nodeCallback,
                                       Vector3f aabbMin,
                                       Vector3f aabbMax)

reportRayOverlappingNodex

public void reportRayOverlappingNodex(NodeOverlapCallback nodeCallback,
                                      Vector3f raySource,
                                      Vector3f rayTarget)

reportBoxCastOverlappingNodex

public void reportBoxCastOverlappingNodex(NodeOverlapCallback nodeCallback,
                                          Vector3f raySource,
                                          Vector3f rayTarget,
                                          Vector3f aabbMin,
                                          Vector3f aabbMax)

quantizeWithClamp

public long quantizeWithClamp(Vector3f point)

unQuantize

public void unQuantize(Vector3f vecOut,
                       long vecIn)