1 #ifndef GIM_BOX_SET_H_INCLUDED 2 #define GIM_BOX_SET_H_INCLUDED 72 int _sort_and_calc_splitting_index(
74 int startIndex,
int endIndex,
int splitAxis);
76 int _calc_splitting_axis(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
78 void _build_sub_tree(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
104 return m_node_array[nodeindex].isLeafNode();
109 return m_node_array[nodeindex].getDataIndex();
114 bound = m_node_array[nodeindex].m_bound;
119 m_node_array[nodeindex].m_bound = bound;
129 if(m_node_array[nodeindex+1].isLeafNode())
return nodeindex+2;
130 return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
135 return m_node_array[nodeindex].getEscapeIndex();
140 return &m_node_array[index];
160 virtual bool is_trimesh()
const = 0;
161 virtual int get_primitive_count()
const = 0;
162 virtual void get_primitive_box(
int prim_index ,
btAABB & primbox)
const = 0;
164 virtual void get_primitive_triangle(
int prim_index,
btPrimitiveTriangle & triangle)
const= 0;
187 m_primitive_manager = NULL;
193 m_primitive_manager = primitive_manager;
199 getNodeBound(0, totalbox);
205 m_primitive_manager = primitive_manager;
210 return m_primitive_manager;
235 return boxQuery(transbox,collided_results);
309 #ifdef TRI_COLLISION_PROFILING 310 static float getAverageTreeCollisionTime();
311 #endif //TRI_COLLISION_PROFILING 318 #endif // GIM_BOXPRUNING_H_INCLUDED
void update()
node manager prototype functions
void push_back(const GIM_PAIR &_Val)
GIM_BVH_TREE_NODE_ARRAY m_node_array
btPrimitiveManagerBase * getPrimitiveManager() const
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
void setNodeBound(int nodeindex, const btAABB &bound)
virtual ~btPrimitiveManagerBase()
void push_pair_inv(int index1, int index2)
int getEscapeNodeIndex(int nodeindex) const
#define SIMD_FORCE_INLINE
bool isTrimesh() const
tells if this set is a trimesh
int getNodeCount() const
node count
const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
btAABB getGlobalBox() const
Prototype Base class for primitive classification.
bool boxQueryTrans(const btAABB &box, const btTransform &transform, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
void push_pair(int index1, int index2)
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.
const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
void getNodeBound(int nodeindex, btAABB &bound) const
bool hasHierarchy() const
tells if this set has hierarcht
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
btGImpactBvh()
this constructor doesn't build the tree. you must call buildSet
int getRightNode(int nodeindex) const
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)
btVector3 can be used to represent 3D points and vectors.
int getEscapeNodeIndex(int nodeindex) const
virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle &triangle) const =0
retrieves only the points of the triangle, and the collision margin
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
btPrimitiveManagerBase * m_primitive_manager
int getNodeData(int nodeindex) const
int getLeftNode(int nodeindex) const
int getNodeData(int nodeindex) const
Node Structure for trees.
Structure for containing Boxes.
btGImpactBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
int getNodeCount() const
node count
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
int getLeftNode(int nodeindex) const
int getRightNode(int nodeindex) const
void getNodeBound(int nodeindex, btAABB &bound) const