23 info(
"We use the assimp library to load 3D file formats including materials, skeletons and animations. "
24 "You can view the skeleton with key K. You can stop all animations with SPACE key.\n"
25 "Switch between perspective and orthographic projection with key 5. "
26 "Switch to front view with key 1, to side view with key 3 and to top view with key 7.\n"
27 "Try the different stereo rendering modes in the menu Camera.");
35 "GLTF/glTF-Sample-Models/hdris/approaching_storm_4k.hdr",
41 "GLTF/glTF-Sample-Models/2.0/DamagedHelmet/glTF/DamagedHelmet.gltf");
47 "DAE/AstroBoy/AstroBoy.dae");
53 SLMaterial* matBlu =
new SLMaterial(am,
"Blue",
SLCol4f(0, 0, 0.2f),
SLCol4f(1, 1, 1), 100, 0.8f, 0);
54 SLMaterial* matRed =
new SLMaterial(am,
"Red",
SLCol4f(0.2f, 0, 0),
SLCol4f(1, 1, 1), 100, 0.8f, 0);
55 SLMaterial* matGre =
new SLMaterial(am,
"Green",
SLCol4f(0, 0.2f, 0),
SLCol4f(1, 1, 1), 100, 0.8f, 0);
56 SLMaterial* matGra =
new SLMaterial(am,
"Gray",
SLCol4f(0.3f, 0.3f, 0.3f),
SLCol4f(1, 1, 1), 100, 0, 0);
70 light1->
powers(0.1f, 1.0f, 1.0f);
76 light2->
powers(0.1f, 1.0f, 1.0f);
113 SLNode *rb, *rl, *rr, *rf, *rt;
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
@ EC_inOutQuad
quadratic easing in and then out
@ EC_inOutQuint
quintic easing in and then out
@ AL_pingPongLoop
loop forward and backwards
SLVec2< SLfloat > SLVec2f
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLCol4f
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLDeviceLocation devLoc
Mobile device location from GPS.
static SLstring modelPath
Path to 3D models.
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimPlayback * animPlaybacksBack()
Manages the playback of an SLAnimation.
SLfloat playbackRate() const
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrackForTranslation(SLNode *target, const SLVec3f &endPos)
void addSkyboxToLoad(SLSkybox *&skybox, const SLstring &path, SLVec2i resolution, SLstring name)
Add skybox with HDR texture to load.
SLstring modelPath() const
void addNodeToLoad(SLNode *&node, const SLstring &modelPath, SLSkybox *skybox=nullptr, SLbool deleteTexImgAfterBuild=false, SLbool loadMeshesOnly=true, SLMaterial *overrideMat=nullptr, float ambientFactor=0.5f, SLbool forceCookTorranceRM=false, SLuint flags=SLProcess_Triangulate|SLProcess_JoinIdenticalVertices|SLProcess_RemoveRedundantMaterials|SLProcess_FindDegenerates|SLProcess_FindInvalidData|SLProcess_SplitLargeMeshes)
Add mesh from file to load via assimp loader.
Toplevel holder of the assets meshes, materials, textures and shaders.
void colors(const SLCol4f &uniformColor)
Sets a uniform background color.
Active or visible camera node class.
void stereoEyeSeparation(const SLfloat es)
void clipFar(const SLfloat cFar)
void clipNear(const SLfloat cNear)
void devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLBackground & background()
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
void powers(SLfloat ambiPow, SLfloat diffPow, SLfloat specPow, const SLCol4f &ambiDiffSpecCol=SLCol4f::WHITE)
Sets the ambient, diffuse and specular powers all with the same color.
SLLightSpot class for a spot light source.
Defines a standard CG material with textures and a shader program.
void skybox(SLSkybox *sb)
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
void updateMeshMat(std::function< void(SLMaterial *m)> setMat, bool recursive)
Updates the mesh material recursively with a material lambda.
void translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
SLRectangle creates a rectangular mesh with a certain resolution.
The SLScene class represents the top level instance holding the scene structure.
SLAnimManager & animManager()
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)