1 #ifndef GIM_BOX_SET_H_INCLUDED 2 #define GIM_BOX_SET_H_INCLUDED 95 m_escapeIndexOrDataIndex = 0;
101 return (m_escapeIndexOrDataIndex>=0);
107 return -m_escapeIndexOrDataIndex;
112 m_escapeIndexOrDataIndex = -index;
119 return m_escapeIndexOrDataIndex;
124 m_escapeIndexOrDataIndex = index;
149 int _sort_and_calc_splitting_index(
151 int startIndex,
int endIndex,
int splitAxis);
153 int _calc_splitting_axis(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
155 void _build_sub_tree(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
168 m_node_array.
clear();
181 return m_node_array[nodeindex].isLeafNode();
186 return m_node_array[nodeindex].getDataIndex();
191 bound = m_node_array[nodeindex].m_bound;
196 m_node_array[nodeindex].m_bound = bound;
206 if(m_node_array[nodeindex+1].isLeafNode())
return nodeindex+2;
207 return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
212 return m_node_array[nodeindex].getEscapeIndex();
217 return &m_node_array[index];
237 virtual bool is_trimesh()
const = 0;
238 virtual int get_primitive_count()
const = 0;
239 virtual void get_primitive_box(
int prim_index ,
btAABB & primbox)
const = 0;
241 virtual void get_primitive_triangle(
int prim_index,
btPrimitiveTriangle & triangle)
const= 0;
264 m_primitive_manager = NULL;
270 m_primitive_manager = primitive_manager;
276 getNodeBound(0, totalbox);
282 m_primitive_manager = primitive_manager;
287 return m_primitive_manager;
312 return boxQuery(transbox,collided_results);
386 #ifdef TRI_COLLISION_PROFILING 387 static float getAverageTreeCollisionTime();
388 #endif //TRI_COLLISION_PROFILING 396 #endif // GIM_BOXPRUNING_H_INCLUDED void update()
node manager prototype functions
GIM_PAIR(int index1, int index2)
GIM_BVH_TREE_NODE_ARRAY m_node_array
GIM_BVH_DATA is an internal GIMPACT collision structure to contain axis aligned bounding box...
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.
void setEscapeIndex(int index)
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)
int m_escapeIndexOrDataIndex
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
GIM_PAIR(const GIM_PAIR &p)
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
void setDataIndex(int index)
const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
int getEscapeIndex() 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