82 SL_LOG(
"Voxels empty : %4.1f%%", voxelsEmpty);
83 SL_LOG(
"Avg. Tria/Voxel: %4.1f", avgTriPerVox);
145 ,
public SLOptixAccelStruct
186 SLbool findRecursive =
true);
189 SLbool findRecursive =
true);
192 SLbool findRecursive =
true,
193 SLbool canContain =
false);
195 SLbool findRecursive =
true);
197 SLbool findRecursive =
true);
310 const std::function<
void(
SLMesh*)>& cbInformNodes);
324 void createInstanceAccelerationStructureTree();
325 void createInstanceAccelerationStructureFlat();
326 void createOptixInstances(vector<OptixInstance>&);
335 SLbool canContain =
false);
337 deque<SLNode*>& list,
340 deque<SLNode*>& list,
378 T* found =
dynamic_cast<T*
>(
this);
381 return findChild<T>(
name, findRecursive);
392 T* found =
dynamic_cast<T*
>(node);
393 if (found && (
name.empty() ||
name == node->name()))
400 T* found = i->findChild<T>(
name, findRecursive);
421 findChildrenHelper<T>(
name, list, findRecursive);
439 T* found =
dynamic_cast<T*
>(node);
443 if (found && (
name.empty() ||
445 list.push_back(found);
450 list.push_back(found);
SLTransformSpace
Describes the relative space a transformation is applied in.
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
deque< SLNode * > SLVNode
SLVNode typedef for a vector of SLNodes.
SLVec3< SLfloat > SLVec3f
Defines an axis aligned bounding box.
SLAnimSkeleton keeps track of a skeletons joints and animations.
SLAnimation is the base container for all animation data.
Drawing states stored in the bits of an unsigned int.
SLbool get(SLuint bit)
Returns the specified bit.
Virtual Eventhandler class.
SLVec3< T > translation() const
void setMatrix(const SLMat4 &A)
Set matrix by other 4x4 matrix.
SLVec3< T > axisX() const
SLVec3< T > axisY() const
SLVec3< T > axisZ() const
Defines a standard CG material with textures and a shader program.
An SLMesh object is a triangulated mesh, drawn with one draw call.
SLNode represents a node in a hierarchical scene graph.
bool updateMeshSkins(bool forceCPUSkinning, const std::function< void(SLMesh *)> &cbInformNodes)
Update all skinned meshes recursively.
void resetToInitialState()
virtual void drawMesh(SLSceneView *sv)
Draws the single mesh.
void rotation(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_parent)
T * find(const SLstring &name="", SLbool findRecursive=true)
function< void()> _onUpdateCB
Optional lambda callback once per update.
void addChild(SLNode *child)
SLubyte _levelForSM
Level of LOD to use for shadow mapping (0 = the visible one will be drawn)
SLMat4f _wmI
inverse world matrix
SLbool drawBit(SLuint bit)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
bool removeMesh()
Returns true if a mesh was assigned and set it to nullptr.
SLAnimation * _animation
animation of the node
SLVec3f forwardOS() const
void animation(SLAnimation *a)
virtual void needUpdate()
void minLodCoverage(SLfloat minLodCoverage)
SLDrawBits _drawBits
node level drawing flags
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
SLAnimation * animation()
SLAABBox _aabb
axis aligned bounding box
SLNode * _parent
pointer to the parent node
const SLMat4f & updateAndGetWM() const
static SLuint numWMUpdates
NO. of calls to updateWMRec per frame.
void castsShadows(SLbool castsShadows)
virtual SLNode * copyRec()
SLMat4f _om
object matrix for local transforms
static unsigned int instanceIndex
???
bool insertChild(SLNode *insertC, SLNode *afterC)
SLbool _isAABBUpToDate
is the saved aabb still valid
SLVec3f translationWS() const
const SLAnimSkeleton * skeleton()
Returns the first skeleton found in the meshes.
void setPrimitiveTypeRec(SLGLPrimitiveType primitiveType)
T * findChild(const SLstring &name="", SLbool findRecursive=true)
SLfloat _minLodCoverage
Min. LOD coverage for visibility (0.0 < _minLodCoverage < 1.0)
SLVec3f translationOS() const
SLMat4f _initialOM
the initial om state
bool _isSelected
flag if node and one or more of its meshes are selected
void isSelected(bool isSelected)
bool _castsShadows
flag if meshes of node should cast shadows
void setMeshMat(SLMaterial *mat, bool recursive)
Set the mesh material recursively.
virtual void cullChildren3D(SLSceneView *sv)
Initializer function to call SLNode::cull3DRec recursively.
virtual void addMesh(SLMesh *mesh)
void entityID(SLint entityID)
void updateMeshAccelStructs()
SLVNode _children
vector of children nodes
void om(const SLMat4f &mat)
virtual void statsRec(SLNodeStats &stats)
const SLMat4f & updateAndGetWMI() const
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
SLMesh * _mesh
pointer to a single mesh
void levelForSM(SLubyte lfsm)
void updateMeshMat(std::function< void(SLMaterial *m)> setMat, bool recursive)
Updates the mesh material recursively with a material lambda.
SLNode(const SLstring &name="Node")
Construct a new SLNode::SLNode object.
SLVec3f forwardWS() const
virtual SLAABBox & updateAABBRec(SLbool updateAlsoAABBinOS)
deque< T * > findChildren(const SLstring &name="", SLbool findRecursive=true, SLbool canContain=false)
SLMat4f _wm
world matrix for world transform
virtual void cull2DRec(SLSceneView *sv)
bool removeChild(SLNode *child)
remove child from vector of children. Removes false if not found, else true.
void scaleToCenter(SLfloat maxDim)
SLbool _isWMIUpToDate
is the inverse WM of this node still valid
SLint _entityID
ID in the SLVEntity graph for Data Oriented Design.
void onUpdateCB(function< void()> callbackFunc)
SLint _depth
depth of the node in a scene tree
const SLMat4f & initialOM()
void findChildrenHelper(const SLstring &name, deque< T * > &list, SLbool findRecursive, SLbool canContain=false)
virtual bool hitRec(SLRay *ray)
SLbool _isWMUpToDate
is the WM of this node still valid
void setDrawBitsRec(SLuint bit, SLbool state)
virtual void cull3DRec(SLSceneView *sv)
void rotateAround(const SLVec3f &point, SLVec3f &axis, SLfloat angleDeg, SLTransformSpace relativeTo=TS_world)
void translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
Base class for all other classes.
void name(const SLstring &Name)
SLstring _name
name of an object
const SLstring & name() const
Ray class with ray and intersection properties.
The SLScene class represents the top level instance holding the scene structure.
SceneView class represents a dynamic real time 3D view onto the scene.
bool containsString(const string &container, const string &search)
Returns true if container contains the search string.
Struct for scene graph statistics.
SLuint numVoxMaxTria
Max. no. of triangles per voxel.
void print() const
Prints all statistic informations on the std out stream.
SLuint numBytesAccel
NO. of bytes in accel. structs.
SLuint numNodesOpaque
NO. of visible opaque nodes.
SLuint numMeshes
NO. of meshes in node.
SLuint numNodes
NO. of children nodes.
SLuint numLights
NO. of lights in mesh.
void clear()
Resets all counters to zero.
SLuint numTriangles
NO. of triangles in mesh.
SLuint numAnimations
NO. of animations.
SLuint numNodesBlended
NO. of visible blended nodes.
SLuint numNodesLeaf
NO. of leaf nodes.
SLuint numVoxels
NO. of voxels.
SLuint numLines
NO. of lines in mesh.
SLuint numNodesGroup
NO. of group nodes.
SLuint numBytes
NO. of bytes allocated.
SLfloat numVoxEmpty
NO. of empty voxels.