27#ifdef TRI_COLLISION_PROFILING
45float btGImpactQuantizedBvh::getAverageTreeCollisionTime()
470 if (
boxset0->getNodeCount() == 0 ||
boxset1->getNodeCount() == 0)
return;
476#ifdef TRI_COLLISION_PROFILING
483#ifdef TRI_COLLISION_PROFILING
bool _quantized_node_collision(const btGImpactQuantizedBvh *boxset0, const btGImpactQuantizedBvh *boxset1, const BT_BOX_BOX_TRANSFORM_CACHE &trans_cache_1to0, int node0, int node1, bool complete_primitive_tests)
static void _find_quantized_collision_pairs_recursive(const btGImpactQuantizedBvh *boxset0, const btGImpactQuantizedBvh *boxset1, btPairSet *collision_pairs, const BT_BOX_BOX_TRANSFORM_CACHE &trans_cache_1to0, int node0, int node1, bool complete_primitive_tests)
const T & btMax(const T &a, const T &b)
void bt_calc_quantization_parameters(btVector3 &outMinBound, btVector3 &outMaxBound, btVector3 &bvhQuantization, const btVector3 &srcMinBound, const btVector3 &srcMaxBound, btScalar quantizationMargin)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define SIMD_FORCE_INLINE
bool overlapping_trans_cache(const btAABB &box, const BT_BOX_BOX_TRANSFORM_CACHE &transcache, bool fulltest) const
transcache is the transformation cache from box to this AABB
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
void resize(int newsize, const T &fillData=T())
The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
void reset()
Resets the initial reference time.
Structure for containing Boxes.
int getNodeData(int nodeindex) const
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
void buildSet()
this rebuild the entire set
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
btQuantizedBvhTree m_box_tree
void setNodeBound(int nodeindex, const btAABB &bound)
int getNodeCount() const
node count
int getRightNode(int nodeindex) const
int getEscapeNodeIndex(int nodeindex) const
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)
virtual int get_primitive_count() const =0
virtual void get_primitive_box(int prim_index, btAABB &primbox) const =0
void setNodeBound(int nodeindex, const btAABB &bound)
btVector3 m_bvhQuantization
void _build_sub_tree(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
void quantizePoint(unsigned short *quantizedpoint, const btVector3 &point) const
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
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 _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
btVector3 can be used to represent 3D points and vectors.
int maxAxis() const
Return the axis with the largest value Note return values are 0,1,2 for x, y, or z.