SLProject 4.0.000
AppDemoLoad.cpp File Reference
#include <SL.h>
#include <GlobalTimer.h>
#include <CVCapture.h>
#include <CVTrackedAruco.h>
#include <CVTrackedChessboard.h>
#include <CVTrackedFaces.h>
#include <CVTrackedFeatures.h>
#include <CVTrackedMediaPipeHands.h>
#include <CVCalibrationEstimator.h>
#include <SLAlgo.h>
#include <AppDemo.h>
#include <SLAssetManager.h>
#include <SLAssimpImporter.h>
#include <SLScene.h>
#include <SLSceneView.h>
#include <SLBox.h>
#include <SLCone.h>
#include <SLCoordAxis.h>
#include <SLCylinder.h>
#include <SLDisk.h>
#include <SLGrid.h>
#include <SLLens.h>
#include <SLLightDirect.h>
#include <SLLightRect.h>
#include <SLLightSpot.h>
#include <SLParticleSystem.h>
#include <SLPoints.h>
#include <SLPolygon.h>
#include <SLRectangle.h>
#include <SLSkybox.h>
#include <SLSphere.h>
#include <SLText.h>
#include <SLTexColorLUT.h>
#include <SLGLProgramManager.h>
#include <SLGLTexture.h>
#include <Profiler.h>
#include <AppDemoGui.h>
#include <SLDeviceLocation.h>
#include <SLNodeLOD.h>
#include <imgui_color_gradient.h>
#include <SLEntities.h>
#include <SLFileStorage.h>
Include dependency graph for AppDemoLoad.cpp:

Functions

SLNode * SphereGroupRT (SLAssetManager *am, SLint depth, SLfloat x, SLfloat y, SLfloat z, SLfloat scale, SLuint resolution, SLMaterial *matGlass, SLMaterial *matRed)
 Creates a recursive sphere group used for the ray tracing scenes. More...
 
SLNode * RotatingSphereGroup (SLAssetManager *am, SLScene *s, SLint depth, SLfloat x, SLfloat y, SLfloat z, SLfloat scale, SLuint resolution, SLVMaterial &mat)
 Creates a recursive rotating sphere group used for performance test. More...
 
SLNode * BuildFigureGroup (SLAssetManager *am, SLScene *s, SLMaterial *mat, SLbool withAnimation)
 Build a hierarchical figurine with arms and legs. More...
 
void addUniverseLevel (SLAssetManager *am, SLScene *s, SLNode *parent, SLint parentID, SLuint currentLevel, SLuint levels, SLuint childCount, SLVMaterial &materials, SLVMesh &meshes, SLuint &numNodes)
 Adds another level to Jan's Universe scene. More...
 
void generateUniverse (SLAssetManager *am, SLScene *s, SLNode *parent, SLint parentID, SLuint levels, SLuint childCount, SLVMaterial &materials, SLVMesh &meshes)
 Generates the Jan's Universe scene. More...
 
SLNode * createComplexFire (SLAssetManager *am, SLScene *s, SLbool withLight, SLGLTexture *texFireCld, SLGLTexture *texFireFlm, SLint flipbookCols, SLint flipbookRows, SLGLTexture *texCircle, SLGLTexture *texSmokeB, SLGLTexture *texSmokeW)
 Creates a complex fire group node. More...
 
SLNode * createTorchFire (SLAssetManager *am, SLScene *s, SLbool withLight, SLGLTexture *texFireCld, SLGLTexture *texFireFlm, SLint flipbookCols, SLint flipbookRows)
 
void appDemoLoadScene (SLAssetManager *am, SLScene *s, SLSceneView *sv, SLSceneID sceneID)
 appDemoLoadScene builds a scene from source code. More...
 

Variables

SLGLTexture * videoTexture
 
CVTracked * tracker
 
SLNode * trackedNode
 
SLGLTexture * gTexMRI3D = nullptr
 Global pointer to 3D MRI texture for volume rendering for threaded loading. More...
 
SLNode * gDragonModel = nullptr
 Global pointer to dragon model for threaded loading. More...
 

Function Documentation

◆ addUniverseLevel()

void addUniverseLevel ( SLAssetManager *  am,
SLScene *  s,
SLNode *  parent,
SLint  parentID,
SLuint  currentLevel,
SLuint  levels,
SLuint  childCount,
SLVMaterial &  materials,
SLVMesh &  meshes,
SLuint &  numNodes 
)

Adds another level to Jan's Universe scene.

◆ appDemoLoadScene()

void appDemoLoadScene ( SLAssetManager *  am,
SLScene *  s,
SLSceneView *  sv,
SLSceneID  sceneID 
)

appDemoLoadScene builds a scene from source code.

Forward declaration of the scene definition function from AppDemoLoad.cpp.

appDemoLoadScene builds a scene from source code. Such a function must be passed as a void*-pointer to slCreateScene. It will be called from within slCreateSceneView as soon as the view is initialized. You could separate different scene by a different sceneID.
The purpose is to assemble a scene by creating scenegraph objects with nodes (SLNode) and meshes (SLMesh). See the scene with SID_Minimal for a minimal example of the different steps.

◆ BuildFigureGroup()

SLNode * BuildFigureGroup ( SLAssetManager *  am,
SLScene *  s,
SLMaterial *  mat,
SLbool  withAnimation 
)

Build a hierarchical figurine with arms and legs.

◆ createComplexFire()

SLNode * createComplexFire ( SLAssetManager *  am,
SLScene *  s,
SLbool  withLight,
SLGLTexture *  texFireCld,
SLGLTexture *  texFireFlm,
SLint  flipbookCols,
SLint  flipbookRows,
SLGLTexture *  texCircle,
SLGLTexture *  texSmokeB,
SLGLTexture *  texSmokeW 
)

Creates a complex fire group node.

◆ createTorchFire()

SLNode * createTorchFire ( SLAssetManager *  am,
SLScene *  s,
SLbool  withLight,
SLGLTexture *  texFireCld,
SLGLTexture *  texFireFlm,
SLint  flipbookCols,
SLint  flipbookRows 
)

◆ generateUniverse()

void generateUniverse ( SLAssetManager *  am,
SLScene *  s,
SLNode *  parent,
SLint  parentID,
SLuint  levels,
SLuint  childCount,
SLVMaterial &  materials,
SLVMesh &  meshes 
)

Generates the Jan's Universe scene.

◆ RotatingSphereGroup()

SLNode * RotatingSphereGroup ( SLAssetManager *  am,
SLScene *  s,
SLint  depth,
SLfloat  x,
SLfloat  y,
SLfloat  z,
SLfloat  scale,
SLuint  resolution,
SLVMaterial &  mat 
)

Creates a recursive rotating sphere group used for performance test.

This performance benchmark is expensive in terms of world matrix updates because all sphere groups rotate. Therefore all children need to update their wm every frame.

Parameters
amPointer to the asset manager
sPointer to project scene aka asset manager
depthMax. allowed recursion depth
xPosition in x direction
yPosition in y direction
zPosition in z direction
scaleScale factor > 0 and < 1 for the children spheres
resolutionNO. of stack and slices of the spheres
matReference to an vector of materials
Returns
Group node of spheres

◆ SphereGroupRT()

SLNode * SphereGroupRT ( SLAssetManager *  am,
SLint  depth,
SLfloat  x,
SLfloat  y,
SLfloat  z,
SLfloat  scale,
SLuint  resolution,
SLMaterial *  matGlass,
SLMaterial *  matRed 
)

Creates a recursive sphere group used for the ray tracing scenes.

Variable Documentation

◆ gDragonModel

SLNode* gDragonModel = nullptr

Global pointer to dragon model for threaded loading.

◆ gTexMRI3D

SLGLTexture* gTexMRI3D = nullptr

Global pointer to 3D MRI texture for volume rendering for threaded loading.

◆ trackedNode

SLNode* trackedNode
extern

Global pointer to a node that from witch the tracker changes the pose. it gets updated in the following onUpdateTracking routine

◆ tracker

CVTracked* tracker
extern

Global pointer for a tracker that is set in AppDemoLoad for video scenes It gets updated in the following onUpdateTracking routine

◆ videoTexture

SLGLTexture* videoTexture
extern

Global pointer for the video texture defined in AppDemoLoad for video scenes It gets updated in the following onUpdateTracking routine