36 _continuousInput(true),
72 lastTime = currentTime;
79 for (
int i = 0; i < 65536; ++i)
242 case 'R':
reset();
break;
303 keyBinds =
"Key bindings: \n";
304 keyBinds +=
"F1: toggle current object \n";
305 keyBinds +=
"F2: toggle continuous input \n\n";
306 keyBinds +=
"1: translation mode \n";
307 keyBinds +=
"2: rotation mode \n";
308 keyBinds +=
"3: rotate around point mode \n";
309 keyBinds +=
"4: look at mode \n\n";
311 keyBinds +=
"Y: Set relative space to Object\n";
312 keyBinds +=
"X: Set relative space to Parent\n";
313 keyBinds +=
"C: Set relative space to World\n\n";
318 case TS_object: space =
"TS_Object";
break;
319 case TS_parent: space =
"TS_Parent";
break;
320 case TS_world: space =
"TS_World";
break;
328 keyBinds +=
"W: forward in " + space +
" space \n";
329 keyBinds +=
"S: backward in " + space +
" space \n";
330 keyBinds +=
"A: left in " + space +
" space \n";
331 keyBinds +=
"D: right in " + space +
" space \n";
332 keyBinds +=
"Q: up in " + space +
" space \n";
333 keyBinds +=
"E: down in " + space +
" space \n";
337 keyBinds +=
"W: rotate around -X in " + space +
"\n";
338 keyBinds +=
"S: rotate around X in " + space +
"\n";
339 keyBinds +=
"A: rotate around Y in " + space +
"\n";
340 keyBinds +=
"D: rotate around -Y in " + space +
"\n";
341 keyBinds +=
"Q: rotate around Z in " + space +
"\n";
342 keyBinds +=
"E: rotate around -Z in " + space +
"\n";
345 mode =
"RotateAround";
346 keyBinds +=
"W: rotate around -X in " + space +
"\n";
347 keyBinds +=
"S: rotate around X in " + space +
"\n";
348 keyBinds +=
"A: rotate around -Y in " + space +
"\n";
349 keyBinds +=
"D: rotate around Y in " + space +
"\n";
350 keyBinds +=
"Q: rotate around Z in " + space +
"\n";
351 keyBinds +=
"E: rotate around -Z in " + space +
"\n\n";
353 keyBinds +=
"Shift-W: pivot forward in " + space +
"\n";
354 keyBinds +=
"Shift-S: pivot left in " + space +
"\n";
355 keyBinds +=
"Shift-A: pivot backward in " + space +
"\n";
356 keyBinds +=
"Shift-D: pivot right in " + space +
"\n";
357 keyBinds +=
"Shift-Q: pivot up in " + space +
"\n";
358 keyBinds +=
"Shift-E: pivot down in " + space +
"\n";
362 keyBinds +=
"W: move lookAt point forward in " + space +
"\n";
363 keyBinds +=
"S: move lookAt point left in " + space +
"\n";
364 keyBinds +=
"A: move lookAt point backward in " + space +
"\n";
365 keyBinds +=
"D: move lookAt point right in " + space +
"\n";
366 keyBinds +=
"Q: move lookAt point up in " + space +
"\n";
367 keyBinds +=
"E: move lookAt point down in " + space +
"\n";
371 keyBinds +=
"\nR: Reset \n";
372 snprintf(m + strlen(m),
sizeof(m),
"%s", keyBinds.c_str());
The AppCommon class holds the top-level instances of the app-demo.
static SLint dpi
Dot per inch resolution of screen.
Node transform test app to demonstrates all transforms of SLNode.
SLKey
Keyboard key codes enumeration.
Extension class with functions for quick line & point drawing.
SLVec3< SLfloat > SLVec3f
static WAI::ModeOrbSlam2 * mode
static SLScene * scene
Pointer to the one and only SLScene instance.
void rotateObject(const SLVec3f &val) const
SLNode * _curObject
current object to transform
SLNode * _moveBoxChild
little child cube
TransformMode _curMode
current transform mode
SLNode * _moveBox
big parent cube
void translateObject(SLVec3f vec) const
SLbool onContinuousKeyPress(SLKey key)
AppNodeSceneView(SLScene *s, int dpi, SLInputManager &inputManager)
SLKey _modifiers
pressed modifier keys
bool _keyStates[65536]
key press states of all keys
void translatePivot(SLVec3f vec)
SLbool onKeyPress(const SLKey key, const SLKey mod)
SLNode * _axesNode
node for axis mesh
SLMat4f _curOrigin
current origin of relative space (orientation and position of axes)
SLbool onKeyRelease(const SLKey key, const SLKey mod)
bool _continuousInput
flag for continuous input processing
void rotateObjectAroundPivot(SLVec3f val) const
SLVec3f _pivotPos
position of the pivot point
SLTransformSpace _curSpace
current transform space
SLfloat _deltaTime
delta time of a frame
static SLTexFont * getFont(SLfloat heightMM, SLint dpi)
returns nearest font for a given height in mm
SLVec3< T > translation() const
void setMatrix(const SLMat4 &A)
Set matrix by other 4x4 matrix.
void identity()
Sets the identity matrix.
SLNode represents a node in a hierarchical scene graph.
void resetToInitialState()
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
const SLMat4f & updateAndGetWM() const
void om(const SLMat4f &mat)
const SLMat4f & updateAndGetWMI() const
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
void rotateAround(const SLVec3f &point, SLVec3f &axis, SLfloat angleDeg, 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.
void selectNodeMesh(SLNode *nodeToSelect, SLMesh *meshToSelect)
Handles the full mesh selection from double-clicks.
void root3D(SLNode *root3D)
SceneView class represents a dynamic real time 3D view onto the scene.
SLScene * _s
Pointer to the scene observed by this scene view.
Texture Font class inherits SLGLTexture for alpha blended font rendering.
void set(const T X, const T Y, const T Z)