32 :
SLScene(
"Jan's Universe Test Scene")
34 info(
"Jan's Universe Test Scene");
67 SLstring matName =
"mat-" + std::to_string(i);
79 materials[i]->diffuse(color);
86 SLstring meshName =
"mesh-" + std::to_string(i);
121 if (currentLevel >= levels)
124 const float degPerChild = 360.0f / (float)childCount;
127 float scaleFactor = 0.25f;
129 for (
SLuint i = 0; i < childCount; i++)
132 string childName =
"Node" + std::to_string(numNodes) +
133 "-L" + std::to_string(currentLevel) +
134 "-C" + std::to_string(i);
135 SLNode* child =
new SLNode(meshes[numNodes % meshes.size()], childName);
137 child->
rotate((
float)i * degPerChild, 0, 0, 1);
139 child->
scale(scaleFactor);
142 string animName =
"Anim" + std::to_string(numNodes);
188 light->
scale(10, 10, 10);
The AppCommon class holds the top-level instances of the app-demo.
const SLuint NUM_CHILDREN
const SLuint NUM_MAT_MESH
Class declaration for an SLScene inherited class.
@ EC_linear
linear easing with constant velocity
vector< SLMaterial * > SLVMaterial
STL vector of material pointers.
vector< SLMesh * > SLVMesh
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLVec4f
SLVec4< SLfloat > SLCol4f
static SLstring texturePath
Path to texture images.
AppDemoSceneJansUniverse()
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
void generateUniverse(SLAssetManager *am, SLScene *s, SLNode *parent, SLint parentID, SLuint levels, SLuint childCount, SLVMaterial &materials, SLVMesh &meshes)
Generates the Jan's Universe scene.
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
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.
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrackForRotation360(SLNode *target, const SLVec3f &axis)
void addTextureToLoad(SLGLTexture *&texture, const SLstring &path, SLint min_filter=GL_LINEAR_MIPMAP_LINEAR, SLint mag_filter=GL_LINEAR, SLTextureType type=TT_unknown, SLint wrapS=GL_REPEAT, SLint wrapT=GL_REPEAT)
Add 2D textures with internal image allocation.
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 clipFar(const SLfloat cFar)
void clipNear(const SLfloat cNear)
void focalDist(const SLfloat f)
SLBackground & background()
void diffuseColor(const SLCol4f &diff)
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
SLLightSpot class for a spot light source.
Defines a standard CG material with textures and a shader program.
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 translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
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)
void doWaitOnIdle(SLbool doWI)
SLSphere creates a sphere mesh based on SLSpheric w. 180 deg polar angle.
void hsva2rgba(const SLVec4 &hsva)
HSVA to RGBA color conversion (http://www.rapidtables.com/convert/color/hsv-to-rgb....