1 #ifndef GIM_QUANTIZED_SET_H_INCLUDED
2 #define GIM_QUANTIZED_SET_H_INCLUDED
49 int startIndex,
int endIndex,
int splitAxis);
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();
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
SIMD_FORCE_INLINE void bt_quantize_clamp(unsigned short *out, const btVector3 &point, const btVector3 &min_bound, const btVector3 &max_bound, const btVector3 &bvhQuantization)
SIMD_FORCE_INLINE btVector3 bt_unquantize(const unsigned short *vecIn, const btVector3 &offset, const btVector3 &bvhQuantization)
unsigned short int m_quantizedAabbMin[3]
unsigned short int m_quantizedAabbMax[3]
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define SIMD_FORCE_INLINE
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
Structure for containing Boxes.
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
SIMD_FORCE_INLINE void getNodeTriangle(int nodeindex, btPrimitiveTriangle &triangle) const
SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
btPrimitiveManagerBase * m_primitive_manager
void buildSet()
this rebuild the entire set
btGImpactQuantizedBvh()
this constructor doesn't build the tree. you must call buildSet
SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
SIMD_FORCE_INLINE btPrimitiveManagerBase * getPrimitiveManager() const
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
btGImpactQuantizedBvh(btPrimitiveManagerBase *primitive_manager)
this constructor doesn't build the tree. you must call buildSet
btQuantizedBvhTree m_box_tree
SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
tells if the node is a leaf
SIMD_FORCE_INLINE void update()
this attemps to refit the box set.
SIMD_FORCE_INLINE bool isTrimesh() const
tells if this set is a trimesh
SIMD_FORCE_INLINE int getNodeCount() const
node count
SIMD_FORCE_INLINE bool hasHierarchy() const
tells if this set has hierarcht
SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const
SIMD_FORCE_INLINE bool boxQueryTrans(const btAABB &box, const btTransform &transform, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
SIMD_FORCE_INLINE void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB &bound)
SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
SIMD_FORCE_INLINE btAABB getGlobalBox() const
SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB &bound) const
static void find_collision(const btGImpactQuantizedBvh *boxset1, const btTransform &trans1, const btGImpactQuantizedBvh *boxset2, const btTransform &trans2, btPairSet &collision_pairs)
Prototype Base class for primitive classification.
virtual void get_primitive_triangle(int prim_index, btPrimitiveTriangle &triangle) const =0
retrieves only the points of the triangle, and the collision margin
virtual bool is_trimesh() const =0
determines if this manager consist on only triangles, which special case will be optimized
Basic Box tree structure.
SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
tells if the node is a leaf
btVector3 m_bvhQuantization
SIMD_FORCE_INLINE void quantizePoint(unsigned short *quantizedpoint, const btVector3 &point) const
SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
void _build_sub_tree(GIM_BVH_DATA_ARRAY &primitive_boxes, int startIndex, int endIndex)
SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB &bound) const
SIMD_FORCE_INLINE void clearNodes()
void calc_quantization(GIM_BVH_DATA_ARRAY &primitive_boxes, btScalar boundMargin=btScalar(1.0))
void build_tree(GIM_BVH_DATA_ARRAY &primitive_boxes)
stackless build tree
SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(int node_index, unsigned short *quantizedMin, unsigned short *quantizedMax) const
SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
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)
SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB &bound)
SIMD_FORCE_INLINE int getNodeCount() const
node count
SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index=0) const