1 #ifndef GIM_QUANTIZED_SET_H_INCLUDED 2 #define GIM_QUANTIZED_SET_H_INCLUDED 49 int _sort_and_calc_splitting_index(
51 int startIndex,
int endIndex,
int splitAxis);
53 int _calc_splitting_axis(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
55 void _build_sub_tree(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
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);
95 return m_node_array[nodeindex].isLeafNode();
100 return m_node_array[nodeindex].getDataIndex();
106 m_node_array[nodeindex].m_quantizedAabbMin,
107 m_global_bound.
m_min,m_bvhQuantization);
110 m_node_array[nodeindex].m_quantizedAabbMax,
111 m_global_bound.
m_min,m_bvhQuantization);
118 m_global_bound.
m_min,
119 m_global_bound.
m_max,
124 m_global_bound.
m_min,
125 m_global_bound.
m_max,
136 if(m_node_array[nodeindex+1].isLeafNode())
return nodeindex+2;
137 return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
142 return m_node_array[nodeindex].getEscapeIndex();
147 return &m_node_array[index];
174 m_primitive_manager = NULL;
180 m_primitive_manager = primitive_manager;
186 getNodeBound(0, totalbox);
192 m_primitive_manager = primitive_manager;
197 return m_primitive_manager;
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 int getRightNode(int nodeindex) const
btGImpactQuantizedBvh()
this constructor doesn't build the tree. you must call buildSet
bool testQuantizedBoxOverlapp(int node_index, unsigned short *quantizedMin, unsigned short *quantizedMax) const
btVector3 m_bvhQuantization
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int getRightNode(int nodeindex) const
int getNodeData(int nodeindex) const
#define SIMD_FORCE_INLINE
btVector3 bt_unquantize(const unsigned short *vecIn, const btVector3 &offset, const btVector3 &bvhQuantization)
int getNodeData(int nodeindex) const
bool isTrimesh() const
tells if this set is a trimesh
btQuantizedBvhTree m_box_tree
Prototype Base class for primitive classification.
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
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 boxQueryTrans(const btAABB &box, const btTransform &transform, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
void setNodeBound(int nodeindex, const btAABB &bound)
int getLeftNode(int nodeindex) const
void update()
node manager prototype functions
int getNodeCount() const
node count
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
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
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
Basic Box tree structure.
void getNodeBound(int nodeindex, btAABB &bound) const
int getLeftNode(int nodeindex) const
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
btPrimitiveManagerBase * m_primitive_manager
bool hasHierarchy() const
tells if this set has hierarcht
btGImpactQuantizedBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
int getNodeCount() const
node count
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
int getEscapeNodeIndex(int nodeindex) const
btQuantizedBvhNode is a compressed aabb node, 16 bytes.
void quantizePoint(unsigned short *quantizedpoint, const btVector3 &point) const
void getNodeBound(int nodeindex, btAABB &bound) const
btAABB getGlobalBox() const
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
Structure for containing Boxes.
void setNodeBound(int nodeindex, const btAABB &bound)
int getEscapeNodeIndex(int nodeindex) const
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...