1 #ifndef GIM_QUANTIZED_SET_H_INCLUDED 2 #define GIM_QUANTIZED_SET_H_INCLUDED 51 int startIndex,
int endIndex,
int splitAxis);
67 unsigned short * quantizedpoint,
const btVector3 & point)
const 75 unsigned short * quantizedMin,
unsigned short * quantizedMax)
const 77 return m_node_array[node_index].testQuantizedBoxOverlapp(quantizedMin,quantizedMax);
137 return nodeindex+1 +
m_node_array[nodeindex+1].getEscapeIndex();
222 return boxQuery(transbox,collided_results);
296 #ifdef TRI_COLLISION_PROFILING 297 static float getAverageTreeCollisionTime();
298 #endif //TRI_COLLISION_PROFILING 305 #endif // GIM_BOXPRUNING_H_INCLUDED
void build_tree(GIM_BVH_DATA_ARRAY &primitive_boxes)
prototype functions for box tree management
void calc_quantization(GIM_BVH_DATA_ARRAY &primitive_boxes, btScalar boundMargin=btScalar(1.0))
int _calc_splitting_axis(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
btGImpactQuantizedBvh()
this constructor doesn't build the tree. you must call buildSet
btVector3 m_bvhQuantization
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
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 * getPrimitiveManager() const
btAABB getGlobalBox() const
int getNodeData(int nodeindex) const
bool testQuantizedBoxOverlapp(int node_index, unsigned short *quantizedMin, unsigned short *quantizedMax) const
#define SIMD_FORCE_INLINE
btVector3 bt_unquantize(const unsigned short *vecIn, const btVector3 &offset, const btVector3 &bvhQuantization)
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
int getEscapeNodeIndex(int nodeindex) const
btQuantizedBvhTree m_box_tree
Prototype Base class for primitive classification.
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.
void bt_quantize_clamp(unsigned short *out, const btVector3 &point, const btVector3 &min_bound, const btVector3 &max_bound, const btVector3 &bvhQuantization)
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
bool isTrimesh() const
tells if this set is a trimesh
void setNodeBound(int nodeindex, const btAABB &bound)
int getNodeCount() const
node count
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
void update()
node manager prototype functions
void quantizePoint(unsigned short *quantizedpoint, const btVector3 &point) const
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
int getNodeCount() const
node count
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 ...
GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) 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
void getNodeBound(int nodeindex, btAABB &bound) const
Basic Box tree structure.
int getLeftNode(int nodeindex) const
btPrimitiveManagerBase * m_primitive_manager
bool hasHierarchy() const
tells if this set has hierarcht
int getRightNode(int nodeindex) const
int getLeftNode(int nodeindex) const
btGImpactQuantizedBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
int _sort_and_calc_splitting_index(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex, int splitAxis)
btQuantizedBvhNode is a compressed aabb node, 16 bytes.
static void find_collision(const btGImpactQuantizedBvh *boxset1, const btTransform &trans1, const btGImpactQuantizedBvh *boxset2, const btTransform &trans2, btPairSet &collision_pairs)
int getNodeData(int nodeindex) const
Structure for containing Boxes.
void setNodeBound(int nodeindex, const btAABB &bound)
int getRightNode(int nodeindex) const
int getEscapeNodeIndex(int nodeindex) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
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 getNodeBound(int nodeindex, btAABB &bound) const
void buildSet()
this rebuild the entire set
void _build_sub_tree(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)