com.bulletphysics.collision.shapes
Class QuantizedBvhNodes

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

public class QuantizedBvhNodes
extends Object
implements Serializable

QuantizedBvhNodes is array of compressed AABB nodes, each of 16 bytes. Node can be used for leaf node or internal node. Leaf nodes can point to 32-bit triangle index (non-negative range).

Implementation note: the nodes are internally stored in int[] array and bit packed. The actual structure is:

 unsigned short  quantizedAabbMin[3]
 unsigned short  quantizedAabbMax[3]
 signed   int    escapeIndexOrTriangleIndex
 

See Also:
Serialized Form

Constructor Summary
QuantizedBvhNodes()
           
 
Method Summary
 int add()
           
 int capacity()
           
 void clear()
           
static int getCoord(long vec, int index)
           
 int getEscapeIndex(int nodeId)
           
 int getEscapeIndexOrTriangleIndex(int nodeId)
           
static int getNodeSize()
           
 int getPartId(int nodeId)
           
 long getQuantizedAabbMax(int nodeId)
           
 int getQuantizedAabbMax(int nodeId, int index)
           
 long getQuantizedAabbMin(int nodeId)
           
 int getQuantizedAabbMin(int nodeId, int index)
           
 int getTriangleIndex(int nodeId)
           
 boolean isLeafNode(int nodeId)
           
 void resize(int num)
           
 void set(int destId, QuantizedBvhNodes srcNodes, int srcId)
           
 void setEscapeIndexOrTriangleIndex(int nodeId, int value)
           
 void setQuantizedAabbMax(int nodeId, int index, int value)
           
 void setQuantizedAabbMax(int nodeId, long value)
           
 void setQuantizedAabbMin(int nodeId, int index, int value)
           
 void setQuantizedAabbMin(int nodeId, long value)
           
 int size()
           
 void swap(int id1, int id2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuantizedBvhNodes

public QuantizedBvhNodes()
Method Detail

add

public int add()

size

public int size()

capacity

public int capacity()

clear

public void clear()

resize

public void resize(int num)

getNodeSize

public static int getNodeSize()

set

public void set(int destId,
                QuantizedBvhNodes srcNodes,
                int srcId)

swap

public void swap(int id1,
                 int id2)

getQuantizedAabbMin

public int getQuantizedAabbMin(int nodeId,
                               int index)

getQuantizedAabbMin

public long getQuantizedAabbMin(int nodeId)

setQuantizedAabbMin

public void setQuantizedAabbMin(int nodeId,
                                long value)

setQuantizedAabbMax

public void setQuantizedAabbMax(int nodeId,
                                long value)

setQuantizedAabbMin

public void setQuantizedAabbMin(int nodeId,
                                int index,
                                int value)

getQuantizedAabbMax

public int getQuantizedAabbMax(int nodeId,
                               int index)

getQuantizedAabbMax

public long getQuantizedAabbMax(int nodeId)

setQuantizedAabbMax

public void setQuantizedAabbMax(int nodeId,
                                int index,
                                int value)

getEscapeIndexOrTriangleIndex

public int getEscapeIndexOrTriangleIndex(int nodeId)

setEscapeIndexOrTriangleIndex

public void setEscapeIndexOrTriangleIndex(int nodeId,
                                          int value)

isLeafNode

public boolean isLeafNode(int nodeId)

getEscapeIndex

public int getEscapeIndex(int nodeId)

getTriangleIndex

public int getTriangleIndex(int nodeId)

getPartId

public int getPartId(int nodeId)

getCoord

public static int getCoord(long vec,
                           int index)