1 #ifndef BT_GIMPACT_BVH_H_INCLUDED
2 #define BT_GIMPACT_BVH_H_INCLUDED
70 int startIndex,
int endIndex,
int splitAxis);
121 return nodeindex + 1;
127 return nodeindex + 1 +
m_node_array[nodeindex + 1].getEscapeIndex();
228 return boxQuery(transbox, collided_results);
300 #ifdef TRI_COLLISION_PROFILING
301 static float getAverageTreeCollisionTime();
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
#define SIMD_FORCE_INLINE
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
Node Structure for trees.
SIMD_FORCE_INLINE void reserve(int _Count)
SIMD_FORCE_INLINE void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
SIMD_FORCE_INLINE void push_back(const GIM_PAIR &_Val)
Basic Box tree structure.
void _build_sub_tree(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
SIMD_FORCE_INLINE int getNodeCount() const
node count
int _calc_splitting_axis(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
GIM_BVH_TREE_NODE_ARRAY m_node_array
SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB &bound)
SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
tells if the node is a leaf
SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB &bound) const
SIMD_FORCE_INLINE void clearNodes()
int _sort_and_calc_splitting_index(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex, int splitAxis)
SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
void build_tree(GIM_BVH_DATA_ARRAY &primitive_boxes)
stackless build tree
Structure for containing Boxes.
void buildSet()
this rebuild the entire set
SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
tells if the node is a leaf
SIMD_FORCE_INLINE 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 boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
SIMD_FORCE_INLINE bool hasHierarchy() const
tells if this set has hierarcht
SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
SIMD_FORCE_INLINE void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
SIMD_FORCE_INLINE bool isTrimesh() const
tells if this set is a trimesh
SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB &bound)
SIMD_FORCE_INLINE void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
SIMD_FORCE_INLINE btPrimitiveManagerBase * getPrimitiveManager() const
btGImpactBvh()
this constructor doesn't build the tree. you must call buildSet
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
SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
SIMD_FORCE_INLINE void update()
this attemps to refit the box set.
btPrimitiveManagerBase * m_primitive_manager
SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB &bound) const
static void find_collision(btGImpactBvh *boxset1, const btTransform &trans1, btGImpactBvh *boxset2, const btTransform &trans2, btPairSet &collision_pairs)
btGImpactBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index=0) const
SIMD_FORCE_INLINE int getNodeCount() const
node count
SIMD_FORCE_INLINE btAABB getGlobalBox() const
void push_pair(int index1, int index2)
void push_pair_inv(int index1, int index2)
Prototype Base class for primitive classification.
virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle &triangle) const =0
retrieves only the points of the triangle, and the collision margin
virtual ~btPrimitiveManagerBase()
virtual bool is_trimesh() const =0
determines if this manager consist on only triangles, which special case will be optimized
virtual int get_primitive_count() const =0
virtual void get_primitive_box(int prim_index, btAABB &primbox) const =0