1 #ifndef BT_GIMPACT_BVH_H_INCLUDED 2 #define BT_GIMPACT_BVH_H_INCLUDED 68 int _sort_and_calc_splitting_index(
70 int startIndex,
int endIndex,
int splitAxis);
72 int _calc_splitting_axis(
GIM_BVH_DATA_ARRAY& primitive_boxes,
int startIndex,
int endIndex);
74 void _build_sub_tree(
GIM_BVH_DATA_ARRAY& primitive_boxes,
int startIndex,
int endIndex);
101 return m_node_array[nodeindex].isLeafNode();
106 return m_node_array[nodeindex].getDataIndex();
111 bound = m_node_array[nodeindex].m_bound;
116 m_node_array[nodeindex].m_bound = bound;
121 return nodeindex + 1;
126 if (m_node_array[nodeindex + 1].isLeafNode())
return nodeindex + 2;
127 return nodeindex + 1 + m_node_array[nodeindex + 1].getEscapeIndex();
132 return m_node_array[nodeindex].getEscapeIndex();
137 return &m_node_array[index];
155 virtual bool is_trimesh()
const = 0;
156 virtual int get_primitive_count()
const = 0;
157 virtual void get_primitive_box(
int prim_index,
btAABB& primbox)
const = 0;
159 virtual void get_primitive_triangle(
int prim_index,
btPrimitiveTriangle& triangle)
const = 0;
181 m_primitive_manager = NULL;
187 m_primitive_manager = primitive_manager;
193 getNodeBound(0, totalbox);
199 m_primitive_manager = primitive_manager;
204 return m_primitive_manager;
228 return boxQuery(transbox, collided_results);
300 #ifdef TRI_COLLISION_PROFILING 301 static float getAverageTreeCollisionTime();
302 #endif //TRI_COLLISION_PROFILING 309 #endif // BT_GIMPACT_BVH_H_INCLUDED
void update()
node manager prototype functions
void push_back(const GIM_PAIR &_Val)
GIM_BVH_TREE_NODE_ARRAY m_node_array
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
void getNodeBound(int nodeindex, btAABB &bound) const
void setNodeBound(int nodeindex, const btAABB &bound)
virtual ~btPrimitiveManagerBase()
void push_pair_inv(int index1, int index2)
#define SIMD_FORCE_INLINE
int getNodeData(int nodeindex) const
void getNodeBound(int nodeindex, btAABB &bound) const
int getNodeData(int nodeindex) const
Prototype Base class for primitive classification.
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
void push_pair(int index1, int index2)
int getLeftNode(int nodeindex) const
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
bool boxQueryTrans(const btAABB &box, const btTransform &transform, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
btGImpactBvh()
this constructor doesn't build the tree. you must call buildSet
Basic Box tree structure.
void appy_transform(const btTransform &trans)
Apply a transform to an AABB.
virtual bool is_trimesh() const =0
determines if this manager consist on only triangles, which special case will be optimized ...
void setNodeBound(int nodeindex, const btAABB &bound)
btPrimitiveManagerBase * getPrimitiveManager() const
btVector3 can be used to represent 3D points and vectors.
virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle &triangle) const =0
retrieves only the points of the triangle, and the collision margin
bool isTrimesh() const
tells if this set is a trimesh
int getLeftNode(int nodeindex) const
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
int getEscapeNodeIndex(int nodeindex) const
btPrimitiveManagerBase * m_primitive_manager
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
bool hasHierarchy() const
tells if this set has hierarcht
Node Structure for trees.
int getNodeCount() const
node count
Structure for containing Boxes.
btGImpactBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
int getRightNode(int nodeindex) const
const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
int getEscapeNodeIndex(int nodeindex) const
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
int getNodeCount() const
node count
btAABB getGlobalBox() const
int getRightNode(int nodeindex) const