1 #ifndef GIM_QUANTIZED_SET_H_INCLUDED 2 #define GIM_QUANTIZED_SET_H_INCLUDED 39 unsigned short int m_quantizedAabbMin[3];
40 unsigned short int m_quantizedAabbMax[3];
46 m_escapeIndexOrDataIndex = 0;
52 return (m_escapeIndexOrDataIndex>=0);
58 return -m_escapeIndexOrDataIndex;
63 m_escapeIndexOrDataIndex = -index;
70 return m_escapeIndexOrDataIndex;
75 m_escapeIndexOrDataIndex = index;
79 unsigned short * quantizedMin,
unsigned short * quantizedMax)
const 81 if(m_quantizedAabbMin[0] > quantizedMax[0] ||
82 m_quantizedAabbMax[0] < quantizedMin[0] ||
83 m_quantizedAabbMin[1] > quantizedMax[1] ||
84 m_quantizedAabbMax[1] < quantizedMin[1] ||
85 m_quantizedAabbMin[2] > quantizedMax[2] ||
86 m_quantizedAabbMax[2] < quantizedMin[2])
115 int _sort_and_calc_splitting_index(
117 int startIndex,
int endIndex,
int splitAxis);
119 int _calc_splitting_axis(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
121 void _build_sub_tree(
GIM_BVH_DATA_ARRAY & primitive_boxes,
int startIndex,
int endIndex);
133 unsigned short * quantizedpoint,
const btVector3 & point)
const 141 unsigned short * quantizedMin,
unsigned short * quantizedMax)
const 143 return m_node_array[node_index].testQuantizedBoxOverlapp(quantizedMin,quantizedMax);
148 m_node_array.
clear();
161 return m_node_array[nodeindex].isLeafNode();
166 return m_node_array[nodeindex].getDataIndex();
172 m_node_array[nodeindex].m_quantizedAabbMin,
173 m_global_bound.
m_min,m_bvhQuantization);
176 m_node_array[nodeindex].m_quantizedAabbMax,
177 m_global_bound.
m_min,m_bvhQuantization);
184 m_global_bound.
m_min,
185 m_global_bound.
m_max,
190 m_global_bound.
m_min,
191 m_global_bound.
m_max,
202 if(m_node_array[nodeindex+1].isLeafNode())
return nodeindex+2;
203 return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
208 return m_node_array[nodeindex].getEscapeIndex();
213 return &m_node_array[index];
240 m_primitive_manager = NULL;
246 m_primitive_manager = primitive_manager;
252 getNodeBound(0, totalbox);
258 m_primitive_manager = primitive_manager;
263 return m_primitive_manager;
288 return boxQuery(transbox,collided_results);
362 #ifdef TRI_COLLISION_PROFILING 363 static float getAverageTreeCollisionTime();
364 #endif //TRI_COLLISION_PROFILING 372 #endif // GIM_BOXPRUNING_H_INCLUDED int getRightNode(int nodeindex) const
bool testQuantizedBoxOverlapp(unsigned short *quantizedMin, unsigned short *quantizedMax) const
int getEscapeIndex() 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
void setEscapeIndex(int index)
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)
virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle &triangle) const =0
retrieves only the points of the triangle, and the collision margin
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.
GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array
int m_escapeIndexOrDataIndex
btPrimitiveManagerBase * getPrimitiveManager() const
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
Basic Box tree structure.
void getNodeBound(int nodeindex, btAABB &bound) const
int getLeftNode(int nodeindex) const
virtual bool is_trimesh() const =0
determines if this manager consist on only triangles, which special case will be optimized ...
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
btPrimitiveManagerBase * m_primitive_manager
bool hasHierarchy() const
tells if this set has hierarcht
void setDataIndex(int index)
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...