Bullet Collision Detection & Physics Library
|
Go to the documentation of this file. 1 #ifndef GIM_QUANTIZED_SET_H_INCLUDED
2 #define GIM_QUANTIZED_SET_H_INCLUDED
49 int startIndex,
int endIndex,
int splitAxis);
66 unsigned short* quantizedpoint,
const btVector3& point)
const
73 unsigned short* quantizedMin,
unsigned short* quantizedMax)
const
75 return m_node_array[node_index].testQuantizedBoxOverlapp(quantizedMin, quantizedMax);
129 return nodeindex + 1;
135 return nodeindex + 1 +
m_node_array[nodeindex + 1].getEscapeIndex();
217 return boxQuery(transbox, collided_results);
289 #ifdef TRI_COLLISION_PROFILING
290 static float getAverageTreeCollisionTime();
291 #endif //TRI_COLLISION_PROFILING
298 #endif // GIM_BOXPRUNING_H_INCLUDED
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
void getNodeBound(int nodeindex, btAABB &bound) 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...
bool isLeafNode(int nodeindex) const
tells if the node is a leaf
btAABB getGlobalBox() const
void getNodeBound(int nodeindex, btAABB &bound) const
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
int getNodeData(int nodeindex) const
btQuantizedBvhNode is a compressed aabb node, 16 bytes.
int getLeftNode(int nodeindex) const
virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle &triangle) const =0
retrieves only the points of the triangle, and the collision margin
btPrimitiveManagerBase * getPrimitiveManager() const
int getNodeData(int nodeindex) const
virtual bool is_trimesh() const =0
determines if this manager consist on only triangles, which special case will be optimized
Basic Box tree structure.
int _calc_splitting_axis(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
int _sort_and_calc_splitting_index(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex, int splitAxis)
btGImpactQuantizedBvh()
this constructor doesn't build the tree. you must call buildSet
int getRightNode(int nodeindex) const
btVector3 m_bvhQuantization
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
int getEscapeNodeIndex(int nodeindex) const
int getNodeCount() const
node count
void update()
node manager prototype functions
void quantizePoint(unsigned short *quantizedpoint, const btVector3 &point) const
btPrimitiveManagerBase * m_primitive_manager
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
btVector3 can be used to represent 3D points and vectors.
bool testQuantizedBoxOverlapp(int node_index, unsigned short *quantizedMin, unsigned short *quantizedMax) const
bool isTrimesh() const
tells if this set is a trimesh
btVector3 bt_unquantize(const unsigned short *vecIn, const btVector3 &offset, const btVector3 &bvhQuantization)
void build_tree(GIM_BVH_DATA_ARRAY &primitive_boxes)
prototype functions for box tree management
bool hasHierarchy() const
tells if this set has hierarcht
GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array
btQuantizedBvhTree m_box_tree
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
#define SIMD_FORCE_INLINE
void bt_quantize_clamp(unsigned short *out, const btVector3 &point, const btVector3 &min_bound, const btVector3 &max_bound, const btVector3 &bvhQuantization)
Prototype Base class for primitive classification.
void appy_transform(const btTransform &trans)
Apply a transform to an AABB.
void calc_quantization(GIM_BVH_DATA_ARRAY &primitive_boxes, btScalar boundMargin=btScalar(1.0))
void setNodeBound(int nodeindex, const btAABB &bound)
void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
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 _build_sub_tree(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
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
const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
int getLeftNode(int nodeindex) const
int getRightNode(int nodeindex) const
int getNodeCount() const
node count
int getEscapeNodeIndex(int nodeindex) const
btGImpactQuantizedBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
Structure for containing Boxes.
void setNodeBound(int nodeindex, const btAABB &bound)
static void find_collision(const btGImpactQuantizedBvh *boxset1, const btTransform &trans1, const btGImpactQuantizedBvh *boxset2, const btTransform &trans2, btPairSet &collision_pairs)
void buildSet()
this rebuild the entire set