12 #include <SENSCamera.h>
14 #define WAIAPP_DEBUG(...) Utils::log("WAIApp", __VA_ARGS__)
15 #define WAIAPP_INFO(...) Utils::log("WAIApp", __VA_ARGS__)
16 #define WAIAPP_WARN(...) Utils::log("WAIApp", __VA_ARGS__)
22 #define WAIAPPSTATE_DEBUG(...) Utils::log("WAIAppStateHandler", __VA_ARGS__)
23 #define WAIAPPSTATE_INFO(...) Utils::log("WAIAppStateHandler", __VA_ARGS__)
24 #define WAIAPPSTATE_WARN(...) Utils::log("WAIAppStateHandler", __VA_ARGS__)
120 WAIAPP_WARN(
"initSceneGraph: SLScene already loaded!");
146 SENSFramePtr frame =
_camera->getLatestFrame();
159 _camera->getFrameSize().height),
168 cv::Mat& img = frame->imgRGB;
171 CVImage::cv2glPixelFormat(img.type()),
182 bool needUpdate =
false;
243 s->
name(
"Loading scene");
244 s->
info(
"Scene shown while starting application");
258 SLstring txt =
"This is text in 3D with font07";
259 SLVec2f size = SLTexFont::font07->calcTextSize(txt);
261 t07->
translate(-size.
x * 0.5f * scale, 1.0f, 0);
264 txt =
"This is text in 3D with font22";
265 size = SLTexFont::font22->calcTextSize(txt);
267 t22->
translate(-size.
x * 0.5f * scale, -1.2f, 0);
283 for (
auto sceneView :
s->sceneViews())
284 if (sceneView !=
nullptr)
285 sceneView->onInitialize();
The AppCommon class holds the top-level instances of the app-demo.
static SLint dpi
Dot per inch resolution of screen.
static SLint scrHeight
Window height at start up.
static SLint scrWidth
Window width at start up.
SLVec4< SLfloat > SLCol4f
#define WAIAPPSTATE_DEBUG(...)
#define WAIAPP_DEBUG(...)
Top level class for the major global instances off an SLProject app.
static SLstring name
Application name.
static SLstring configPath
Default path for calibration files.
static SLScene * scene
Pointer to the one and only SLScene instance.
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...
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.
SLbool copyVideoImage(SLint camWidth, SLint camHeight, CVPixelFormatGL glFormat, SLuchar *data, SLbool isContinuous, SLbool isTopLeft)
Copies the image data from a video camera into the current video image.
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
SLLightSpot class for a spot light source.
SLCol4f diffuse() override
Returns normally _diffuseColor * _diffusePower.
SLCol4f specular() override
Returns normally _specularColor * _specularPower.
SLCol4f ambient() override
Return normally _ambientColor * _ambientPower.
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)
void name(const SLstring &Name)
The SLScene class represents the top level instance holding the scene structure.
bool onUpdate(bool renderTypeIsRT, bool voxelsAreShown, bool forceCPUSkinning)
Updates animations and AABBs.
void root3D(SLNode *root3D)
void init(SLAssetManager *am)
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)
void init(SLstring name, SLint screenWidth, SLint screenHeight, void *onWndUpdateCallback, void *onSelectNodeMeshCallback, SLUiInterface *gui, const string &configPath)
void setViewportFromRatio(const SLVec2i &vpRatio, SLViewportAlign vpAlignment, SLbool vpSameAsVideo)
Sets the viewport ratio and the viewport rectangle.
void doWaitOnIdle(SLbool doWI)
SLSphere creates a sphere mesh based on SLSpheric w. 180 deg polar angle.
SLText creates a mesh using a textured font from SLTexFont.
SLGLTexture * _videoImage
void init(int screenWidth, int screenHeight, int screenDpi, AppDirectories directories)
void initDirectories(AppDirectories directories)
std::function< void()> CloseAppCallback
void initCloseAppCallback(CloseAppCallback cb)
void initCamera(SENSCamera *camera)
void initSceneGraph(int scrWidth, int scrHeight, int dpi)
CloseAppCallback _closeAppCallback