21 :
SLScene(
"Benchmark Node Animation Test Scene")
23 info(
"Performance test for transform updates from many animations.");
50 light1->
powers(0.2f, 0.8f, 1.0f);
59 const int NUM_MAT = 20;
61 for (
int i = 0; i < NUM_MAT; ++i)
66 SLstring matName =
"mat-" + std::to_string(i);
74 mat[i]->diffuse(color);
80 SLint resolution = 18;
122 assert(scale >= 0.0f && scale <= 1.0f);
123 assert(resolution > 0 && resolution < 64);
129 static int sphereNum = 0;
130 string meshName =
"Mesh" + std::to_string(sphereNum);
131 string animName =
"Anim" + std::to_string(sphereNum);
132 string nodeName =
"Node" + std::to_string(sphereNum);
171 sGroup->
addChild(
RotatingSpheres(am,
s, depth, 6.43951f * scale, 0, 1.72546f * scale, scale / 3.0f, resolution, mat));
172 sGroup->
addChild(
RotatingSpheres(am,
s, depth, 1.72546f * scale, 0, 6.43951f * scale, scale / 3.0f, resolution, mat));
173 sGroup->
addChild(
RotatingSpheres(am,
s, depth, -4.71405f * scale, 0, 4.71405f * scale, scale / 3.0f, resolution, mat));
174 sGroup->
addChild(
RotatingSpheres(am,
s, depth, -6.43951f * scale, 0, -1.72546f * scale, scale / 3.0f, resolution, mat));
175 sGroup->
addChild(
RotatingSpheres(am,
s, depth, -1.72546f * scale, 0, -6.43951f * scale, scale / 3.0f, resolution, mat));
176 sGroup->
addChild(
RotatingSpheres(am,
s, depth, 4.71405f * scale, 0, -4.71405f * scale, scale / 3.0f, resolution, mat));
177 sGroup->
addChild(
RotatingSpheres(am,
s, depth, 2.72166f * scale, 5.44331f * scale, 2.72166f * scale, scale / 3.0f, resolution, mat));
178 sGroup->
addChild(
RotatingSpheres(am,
s, depth, -3.71785f * scale, 5.44331f * scale, 0.99619f * scale, scale / 3.0f, resolution, mat));
179 sGroup->
addChild(
RotatingSpheres(am,
s, depth, 0.99619f * scale, 5.44331f * scale, -3.71785f * scale, scale / 3.0f, resolution, mat));
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
@ EC_linear
linear easing with constant velocity
vector< SLMaterial * > SLVMaterial
STL vector of material pointers.
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLVec4f
SLVec4< SLfloat > SLCol4f
static SLstring texturePath
Path to texture images.
void registerAssetsToLoad(SLAssetLoader &al) override
All assets the should be loaded in parallel must be registered in here.
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
AppDemoSceneAnimNodeMass2()
SLNode * RotatingSpheres(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.
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrackForRotation360(SLNode *target, const SLVec3f &axis)
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()
Texture object for OpenGL texturing.
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.
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
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....
float random(float min, float max)
Returns a uniform distributed random float number between min and max.