10 #define SL_COMPACTGRID 
vector< SLushort > SLVushort
 
std::function< void(const SLuint, const SLuint)> triVoxCallback
 
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
 
Extension class with functions for quick line & point drawing.
 
SLAccelStruct is an abstract base class for acceleration structures.
 
Class for compact uniform grid acceleration structure.
 
SLVec3f _voxelSizeHalf
half size of a voxel
 
SLVec3f voxelCenter(const SLVec3i &pos) const
Returns the voxel center point for a given voxel by index.
 
SLVec3f _voxelSize
size of a voxel
 
SLuint _numTriangles
NO. of triangles in the mesh.
 
void build(SLVec3f minV, SLVec3f maxV)
 
SLuint indexAtPos(const SLVec3i &p) const
 
void updateStats(SLNodeStats &stats)
Updates the statistics in the parent node.
 
SLVuint _voxelOffsets
Offset array (C in the paper)
 
void deleteAll()
Deletes the entire uniform grid data.
 
SLVec3ui _size
num. of voxel in grid dir.
 
SLVushort _triangleIndexes16
16 bit triangle index array (L in the paper)
 
SLVuint _triangleIndexes32
32 bit triangle index array (L in the paper)
 
SLbool intersect(SLRay *ray, SLNode *node)
 
void draw(SLSceneView *sv)
SLCompactGrid::draw draws the non-empty voxels of the uniform grid.
 
SLGLVertexArrayExt _vao
Vertex array object for rendering.
 
void getMinMaxVoxel(const Triangle &triangle, SLVec3i &minCell, SLVec3i &maxCell)
Returns the min. and max. voxel of a triangle.
 
SLVec3i containingVoxel(const SLVec3f &p) const
Returns the indices of the voxel around a given point.
 
void ifTriangleInVoxelDo(triVoxCallback cb)
Loops over triangles gets their voxels and calls the callback function.
 
std::array< SLVec3f, 3 > Triangle
 
SLGLVertexArray adds Helper Functions for quick Line & Point Drawing.
 
void clearAttribs()
Clears the attribute definition.
 
SLuint vaoID() const
Returns either the VAO id or the VBO id.
 
An SLMesh object is a triangulated mesh, drawn with one draw call.
 
SLNode represents a node in a hierarchical scene graph.
 
Ray class with ray and intersection properties.
 
SceneView class represents a dynamic real time 3D view onto the scene.
 
Struct for scene graph statistics.