25 :
SLScene(
"Christoffel Tower AR")
27 info(
"Augmented Reality Christoffel Tower");
40 "erleb-AR/models/bern/bern-christoffel.gltf");
124 "erleb-AR/models/bern/DEM-Bern-2600_1199-WGS84.tif");
160 sunLight->
translate(-44.89f, 18.05f, -26.07f);
161 sunLight->
powers(1.0f, 1.5f, 1.0f);
168 sunLight->
shadowMap()->cascadesFactor(3.0);
217 axis->
rotate(-90, 1, 0, 0);
245 #if defined(SL_OS_MACIOS) || defined(SL_OS_ANDROID)
The AppCommon class holds the top-level instances of the app-demo.
SLGLTexture * gVideoTexture
Class declaration for an SLScene inherited class.
@ VT_MAIN
Main camera on all on all all devices.
#define SL_DB_WITHEDGES
Draw faces with hard edges.
#define SL_DB_MESHWIRED
Draw polygons as wired mesh.
#define SL_DB_HIDDEN
Flags an object as hidden.
@ CA_turntableYUp
Orbiting around central object w. turntable rotation around y & right axis.
@ CA_deviceRotLocYUp
The device rotation controls the camera rotation and the GPS controls the Camera Translation.
@ EC_inOutQuint
quintic easing in and then out
@ AL_pingPongLoop
loop forward and backwards
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLCol4f
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLDeviceLocation devLoc
Mobile device location from GPS.
static SLstring texturePath
Path to texture images.
static SLstring shaderPath
Path to GLSL shader programs.
static SLstring dataPath
Path to data directory (it is set platform dependent)
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.
AppDemoSceneErlebARBernChristoffel()
void videoType(CVVideoType vt)
Setter for video type also sets the active calibration.
static CVCapture * instance()
Public static instance getter for singleton pattern.
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrackForRotation(SLNode *target, SLfloat angleDeg1, const SLVec3f &axis)
SLNodeAnimTrack * createNodeAnimTrackForTranslation(SLNode *target, const SLVec3f &endPos)
void addProgramToLoad(SLGLProgram *&program, const SLstring &vertShaderFile, const SLstring &fragShaderFile)
Add generic GLSL program with shader files to load.
void addGeoTiffToLoad(SLDeviceLocation &devLoc, const SLstring &imageFileWithPath)
Add GeoTiff file to load for the SLDevLocation.
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.
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 texture(SLGLTexture *backgroundTexture, bool fixAspectRatio=false)
If flag _repeatBlurred is true the texture is not distorted if its size does not fit to screen aspect...
Active or visible camera node class.
void clipFar(const SLfloat cFar)
void clipNear(const SLfloat cNear)
void devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLBackground & background()
void camAnim(SLCamAnim ca)
Axis aligned coordinate axis mesh.
void defaultLatLonAlt(int degreesLat, int minutesLat, double secondsLat, int degreesLon, int minutesLon, double secondsLon, double altitudeM)
Default coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds.
void useOriginAltitude(SLbool useGLA)
void improveOrigin(SLbool impO)
void originLatLonAlt(int degreesLat, int minutesLat, double secondsLat, int degreesLon, int minutesLon, double secondsLon, double altitudeM)
Origin coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds.
SLbool calculateSolarAngles(SLVec3d locationLatLonAlt, std::time_t time)
Calculates the solar angles at origin at local time.
SLVec3d defaultENU() const
void activeNamedLocation(SLint locIndex)
void sunLightNode(SLLightDirect *sln)
void isUsed(SLbool isUsed)
Setter that turns on the device rotation sensor.
SLVec3d originENU() const
SLVLocation & nameLocations()
void locMaxDistanceM(SLfloat maxDist)
void offsetMode(SLLocOffsetMode lom)
void hasOrigin(SLbool hasOL)
void offsetMode(SLRotOffsetMode rom)
void zeroYawAtStart(SLbool zeroYaw)
void isUsed(SLbool isUsed)
Setter that turns on the device rotation sensor.
Texture object for OpenGL texturing.
void texType(SLTextureType bt)
SLLightDirect class for a directional light source.
void doSunPowerAdaptation(SLbool enabled)
void createShadowMapAutoSize(SLCamera *camera, SLVec2i texSize=SLVec2i(1024, 1024), int numCascades=4) override
void createsShadows(SLbool createsShadows)
void shadowMaxBias(SLfloat maxBias)
void shadowMap(SLShadowMap *shadowMap)
void doSmoothShadows(SLbool doSS)
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.
void shadowMinBias(SLfloat minBias)
class for a named location with lat-lon-Alt WGS84 position
Defines a standard CG material with textures and a shader program.
void translucency(SLfloat transl)
void reflectionModel(SLReflectionModel rm)
void addTexture(SLGLTexture *texture)
Adds the passed texture to the equivalent texture type vector.
void ambient(const SLCol4f &ambi)
void transmissive(const SLCol4f &transm)
void program(SLGLProgram *sp)
void getsShadows(SLbool receivesShadows)
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
SLVec3f forwardOS() const
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
void castsShadows(SLbool castsShadows)
T * findChild(const SLstring &name="", SLbool findRecursive=true)
void setMeshMat(SLMaterial *mat, bool recursive)
Set the mesh material recursively.
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
void setDrawBitsRec(SLuint bit, SLbool state)
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)