1#ifndef GIM_QUANTIZED_SET_H_INCLUDED
2#define GIM_QUANTIZED_SET_H_INCLUDED
49 int startIndex,
int endIndex,
int splitAxis);
66 unsigned short* quantizedpoint,
const btVector3& point)
const
73 unsigned short* quantizedMin,
unsigned short* quantizedMax)
const
75 return m_node_array[node_index].testQuantizedBoxOverlapp(quantizedMin, quantizedMax);
129 return nodeindex + 1;
135 return nodeindex + 1 +
m_node_array[nodeindex + 1].getEscapeIndex();
217 return boxQuery(transbox, collided_results);
276 return m_box_tree.getEscapeNodeIndex(nodeindex);
289#ifdef TRI_COLLISION_PROFILING
290 static float getAverageTreeCollisionTime();
void bt_quantize_clamp(unsigned short *out, const btVector3 &point, const btVector3 &min_bound, const btVector3 &max_bound, const btVector3 &bvhQuantization)
btVector3 bt_unquantize(const unsigned short *vecIn, const btVector3 &offset, const btVector3 &bvhQuantization)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define SIMD_FORCE_INLINE
void appy_transform(const btTransform &trans)
Apply a transform to an AABB.
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
Structure for containing Boxes.
int getNodeData(int nodeindex) const
bool boxQueryTrans(const btAABB &box, const btTransform &transform, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
bool rayQuery(const btVector3 &ray_dir, const btVector3 &ray_origin, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
btPrimitiveManagerBase * m_primitive_manager
btPrimitiveManagerBase * getPrimitiveManager() const
void buildSet()
this rebuild the entire set
btGImpactQuantizedBvh()
this constructor doesn't build the tree. you must call buildSet
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
btGImpactQuantizedBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
btQuantizedBvhTree m_box_tree
void setNodeBound(int nodeindex, const btAABB &bound)
int getNodeCount() const
node count
int getRightNode(int nodeindex) const
void update()
node manager prototype functions
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
int getEscapeNodeIndex(int nodeindex) const
btAABB getGlobalBox() const
bool isTrimesh() const
tells if this set is a trimesh
void getNodeBound(int nodeindex, btAABB &bound) const
int getLeftNode(int nodeindex) const
static void find_collision(const btGImpactQuantizedBvh *boxset1, const btTransform &trans1, const btGImpactQuantizedBvh *boxset2, const btTransform &trans2, btPairSet &collision_pairs)
bool hasHierarchy() const
tells if this set has hierarcht
Prototype Base class for primitive classification.
Basic Box tree structure.
void setNodeBound(int nodeindex, const btAABB &bound)
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
btVector3 m_bvhQuantization
void getNodeBound(int nodeindex, btAABB &bound) const
int getRightNode(int nodeindex) const
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
void _build_sub_tree(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
void quantizePoint(unsigned short *quantizedpoint, const btVector3 &point) const
int getNodeCount() const
node count
void calc_quantization(GIM_BVH_DATA_ARRAY &primitive_boxes, btScalar boundMargin=btScalar(1.0))
void build_tree(GIM_BVH_DATA_ARRAY &primitive_boxes)
prototype functions for box tree management
int getEscapeNodeIndex(int nodeindex) const
GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array
int _sort_and_calc_splitting_index(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex, int splitAxis)
int getNodeData(int nodeindex) const
int _calc_splitting_axis(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
bool testQuantizedBoxOverlapp(int node_index, unsigned short *quantizedMin, unsigned short *quantizedMax) const
int getLeftNode(int nodeindex) const
btVector3 can be used to represent 3D points and vectors.
btQuantizedBvhNode is a compressed aabb node, 16 bytes.