SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLCamera.h
Go to the documentation of this file.
1 /**
2  * \file SLCamera.h
3  * \date July 2014
4  * \remarks Please use clangformat to format the code. See more code style on
5  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
6  * \authors Marc Wacker, Marcus Hudritsch
7  * \copyright http://opensource.org/licenses/GPL-3.0
8  */
9 
10 #ifndef SLCAMERA_H
11 #define SLCAMERA_H
12 
13 #include <SLBackground.h>
14 #include <SLEnums.h>
15 #include <SLGLState.h>
16 #include <SLGLVertexArrayExt.h>
17 #include <SLNode.h>
18 #include <SLPlane.h>
19 #include <SLRay.h>
20 #include <SLRaySamples2D.h>
21 #include <SLRect.h>
22 
23 class SLSceneView;
24 class SLDeviceRotation;
25 class SLDeviceLocation;
26 
27 class SLCameraAnimation;
28 
29 //-----------------------------------------------------------------------------
30 //! Active or visible camera node class
31 /*! An instance of this SLNode derived class serves as an active camera with
32 all its view and projection parameters or if inactive as a visible scene graph
33 node with camera body and its view frustum. The position and orientation
34 of the active camera is set in the setView method by loading the view matrix _vm
35 into the OpenGL modelview matrix. The view matrix _vm is simply the inverse of
36 the shapes world matrix _wm. Every SLSceneView instance has a pointer _camera
37 to its active camera.\n
38 Because the SLNode class is inherited from the abstract SLEventHandler class a
39 camera can handle mouse & keyboard event. All camera animations are handled in
40 these event handlers.\n
41 The following camera animations are available:\n
42  - SLCamAnim::CA_turntableYUp
43  - SLCamAnim::CA_turntableZUp
44  - SLCamAnim::CA_trackball
45  - SLCamAnim::CA_walkingYUp
46  - SLCamAnim::CA_walkingZUp
47  - SLCamAnim::CA_deviceRotYUp
48 \n
49 Every camera has an instance of SLBackground that defines the views background
50 if the camera is the active one. If the camera is inactive the background gets
51 drawn on the far clipping plane of the visualized view frustum.
52 */
53 class SLCamera : public SLNode
54 {
55 public:
56  explicit SLCamera(const SLstring& name = "Camera");
57  ~SLCamera() override;
58 
59  void statsRec(SLNodeStats& stats) override;
60  void drawMesh(SLSceneView* sv) override;
61  virtual SLbool camUpdate(SLSceneView* sv, SLfloat timeMS);
62  void preShade(SLRay* ray) { (void)ray; }
63  void calcMinMax(SLVec3f& minV, SLVec3f& maxV) const;
64  void buildAABB(SLAABBox& aabb, const SLMat4f& wmNode);
66 
67  // Event handlers for camera animation
68  SLbool onMouseDown(SLMouseButton button, SLint x, SLint y, SLKey mod) override;
69  SLbool onMouseMove(SLMouseButton button, SLint x, SLint y, SLKey mod) override;
70  SLbool onMouseUp(SLMouseButton button, SLint x, SLint y, SLKey mod) override;
71  SLbool onMouseWheel(SLint delta, SLKey mod) override;
72  SLbool onTouch2Down(SLint x1, SLint y1, SLint x2, SLint y2) override;
73  SLbool onTouch2Move(SLint x1, SLint y1, SLint x2, SLint y2) override;
74  SLbool onTouch2Up(SLint x1, SLint y1, SLint x2, SLint y2) override;
75  SLbool onKeyPress(SLKey key, SLKey mod) override;
76  SLbool onKeyRelease(SLKey key, SLKey mod) override;
77 
78  void eyeToPixelRay(SLfloat x, SLfloat y, SLRay* ray);
79  void UVWFrame(SLVec3f& EYE, SLVec3f& U, SLVec3f& V, SLVec3f& W);
80  SLVec2f projectWorldToNDC(const SLVec4f& worldPos) const;
81  SLVec3f trackballVec(SLint x, SLint y) const;
83  void passToUniforms(SLGLProgram* program);
84 
85  // Apply projection, viewport and view transformations
86  void setViewport(SLSceneView* sv, SLEyeType eye);
88  void setView(SLSceneView* sv, SLEyeType eye);
89  void setFrustumPlanes();
90 
91  // Setters
93  {
94  _projType = p;
96  }
97  //! vertical field of view
98  void fov(const SLfloat fov)
99  {
100  _fovV = fov;
101  currentFOV = fov;
102  }
104  {
105  _camAnim = ca;
106  currentAnimation = ca;
107  }
108  void clipNear(const SLfloat cNear) { _clipNear = cNear; }
109  void clipFar(const SLfloat cFar) { _clipFar = cFar; }
110  void lookFrom(const SLVec3f& fromDir,
111  const SLVec3f& upDir = SLVec3f::AXISY);
112  void maxSpeed(const SLfloat ms) { _maxSpeed = ms; }
113  void moveAccel(const SLfloat accel) { _moveAccel = accel; }
114  void brakeAccel(const SLfloat accel) { _brakeAccel = accel; }
115  void drag(const SLfloat drag) { _drag = drag; }
116  void focalDist(const SLfloat f) { _focalDist = f; }
117  void lensDiameter(const SLfloat d) { _lensDiameter = d; }
121  {
122  _devRot = devRot;
123  _devLoc = devLoc;
124  }
125  void fogIsOn(const bool isOn) { _fogIsOn = isOn; }
126  void fogMode(const SLFogMode mode) { _fogMode = mode; }
127  void fogDensity(const float density) { _fogDensity = density; }
128  void onCamUpdateCB(function<void(SLSceneView* sv)> callbackFunc) { _onCamUpdateCB = callbackFunc; }
129 
130  // Getters
131  const SLMat4f& updateAndGetVM() const { return updateAndGetWMI(); }
132  SLProjType projType() const { return _projType; }
134  SLfloat unitScaling() const { return _unitScaling; }
135  SLfloat fovV() const { return _fovV; } //!< Vertical field of view
136  SLfloat fovH() const; //!< Horizontal field of view
137 
138  SLRecti viewport() const { return _viewport; }
139  SLfloat aspect() const { return _viewportRatio; }
140  SLfloat clipNear() const { return _clipNear; }
141  SLfloat clipFar() const { return _clipFar; }
142  SLCamAnim camAnim() const { return _camAnim; }
143  SLstring animationStr() const;
144 
146  SLint stereoEye() const { return _stereoEye; }
148 
149  SLfloat lensDiameter() const { return _lensDiameter; }
151  SLfloat focalDist() const { return _focalDist; }
152  SLfloat focalDistScrW() const;
153  SLfloat focalDistScrH() const;
156 
157  SLbool fogIsOn() const { return _fogIsOn; }
158  SLFogMode fogMode() const { return _fogMode; }
159  SLfloat fogDensity() const { return _fogDensity; }
160  SLfloat fogDistStart() const { return _fogStart; }
161  SLfloat fogDistEnd() const { return _fogEnd; }
162  SLCol4f fogColor() const { return _fogColor; }
163 
166  SLfloat maxSpeed() const { return _maxSpeed; }
167  SLfloat moveAccel() const { return _moveAccel; }
168  SLfloat brakeAccel() const { return _brakeAccel; }
169  SLfloat drag() const { return _drag; }
170  SLstring toString() const;
173 
174  // update rotation matrix _enucorrRenu
175  void updateEnuCorrRenu(SLSceneView* sv, const SLMat3f& enuRc, float& f, SLVec3f& enuOffsetPix);
176 
177  // Static global default parameters for new cameras
182  static SLstring projTypeToStr(SLProjType pt);
183 
184 protected:
185  // projection parameters
186  SLProjType _projType; //!< Projection type
187  SLfloat _fovV; //!< Current vertical field of view (view angle) in degrees
188  SLfloat _fovInit; //!< Initial vertical field of view (view angle) in degrees
189  SLfloat _clipNear; //!< Dist. to the near clipping plane
190  SLfloat _clipFar; //!< Dist. to the far clipping plane
191  SLPlane _plane[6]; //!< 6 frustum planes (l, r, t, b, n, f)
192  SLRecti _viewport; //!< framebuffer rectangle
193  SLfloat _viewportRatio; //!< viewport.width / viewport.height = screen ratio
194  SLfloat _fx; //!< horizontal focal length
195  SLfloat _fy; //!< vertical focal length
196  SLfloat _cx; //!< sensor center in x direction
197  SLfloat _cy; //!< sensor center in y direction
198  SLBackground _background; //!< Colors or texture displayed in the background
199 
200  SLGLVertexArrayExt _vao; //!< OpenGL Vertex array for rendering
201 
202  SLbool _movedLastFrame; //! did the camera updateRec in the last frame?
203  SLCamAnim _camAnim; //!< Type of camera animation
204  SLVec2f _oldTouchPos1; //!< Old mouse/touch position in pixels
205  SLVec2f _oldTouchPos2; //!< Old 2nd finger touch position in pixels
206  SLVec3f _trackballStartVec; //!< Trackball vector at mouse down
207  SLfloat _trackballSize; //!< Size of trackball (0.8 = 80% of window size)
208 
209  SLchar _keyStates[256]; //!< Stores for all movement keys whether they are pressed
210  SLfloat _drag; //!< simple constant drag that affects velocity
211  SLfloat _maxSpeed; //!< maximum speed in m/s, with high drag values this speed might not be achievable at all
212  SLVec3f _velocity; //!< current velocity vector
213  SLVec3f _acceleration; //!< current acceleration vector
214  SLfloat _brakeAccel; //!< brake acceleration
215  SLfloat _moveAccel; //!< move acceleration
216 
217  // ray tracing parameters
218  SLfloat _focalDist; //!< distance to lookAt point on the focal plane from lens
219  SLfloat _lensDiameter; //!< Lens diameter
220  SLRaySamples2D _lensSamples; //!< sample points for lens sampling (DOF)
221 
222  // Stereo rendering
223  SLfloat _stereoEyeSeparation; //!< eye separation for stereo mode
224  SLfloat _unitScaling; //!< indicate what the current unit scale is
225  SLint _stereoEye; //!< -1=left, 0=center, 1=right
226  SLMat3f _stereoColorFilter; //!< color filter matrix for anaglyphling is to adjust movement and stereo rendering correctly
227 
228  // fog
229  SLbool _fogIsOn; //!< Flag if fog blending is enabled
230  SLFogMode _fogMode; //!< 0=LINEAR, 1=EXP, 2=EXP2
231  SLfloat _fogDensity; //!< Fog density for exponential modes
232  SLfloat _fogStart; //!< Fog start distance for linear mode
233  SLfloat _fogEnd; //!< Fog end distance for linear mode
234  SLCol4f _fogColor; //!< fog color blended to the final color
235  SLbool _fogColorIsBack; //!< fog color blended to the final color
236 
239 
240  SLRectf _selectRect; //!< Mouse selection rectangle. See SLMesh::handleRectangleSelection
241  SLRectf _deselectRect; //!< Mouse deselection rectangle. See SLMesh::handleRectangleSelection
242 
243  //! parameter for manual finger rotation and translation
247 
249 };
250 //-----------------------------------------------------------------------------
251 #endif
float SLfloat
Definition: SL.h:173
unsigned int SLuint
Definition: SL.h:171
char SLchar
Definition: SL.h:162
bool SLbool
Definition: SL.h:175
string SLstring
Definition: SL.h:158
int SLint
Definition: SL.h:170
SLCamAnim
Enumeration for available camera animation types.
Definition: SLEnums.h:121
SLProjType
Enumeration for different camera projections.
Definition: SLEnums.h:134
SLMouseButton
Mouse button codes.
Definition: SLEnums.h:98
SLFogMode
Corresponds to the old fog modes in OpenGL 2.1.
Definition: SLEnums.h:263
SLEyeType
Enumeration for stereo eye type used for camera projection.
Definition: SLEnums.h:152
SLKey
Keyboard key codes enumeration.
Definition: SLEnums.h:16
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
Singleton class for global render state.
Extension class with functions for quick line & point drawing.
static WAI::ModeOrbSlam2 * mode
Definition: WAIInterface.cpp:5
Defines an axis aligned bounding box.
Definition: SLAABBox.h:34
Defines a 2D-Background for the OpenGL framebuffer background.
Definition: SLBackground.h:29
Active or visible camera node class.
Definition: SLCamera.h:54
SLfloat _drag
simple constant drag that affects velocity
Definition: SLCamera.h:210
SLRaySamples2D _lensSamples
sample points for lens sampling (DOF)
Definition: SLCamera.h:220
SLFogMode _fogMode
0=LINEAR, 1=EXP, 2=EXP2
Definition: SLCamera.h:230
SLbool onTouch2Down(SLint x1, SLint y1, SLint x2, SLint y2) override
Definition: SLCamera.cpp:1280
SLDeviceLocation * _devLoc
Definition: SLCamera.h:238
SLRaySamples2D * lensSamples()
Definition: SLCamera.h:150
SLfloat focalDist() const
Definition: SLCamera.h:151
SLfloat _fx
horizontal focal length
Definition: SLCamera.h:194
SLfloat lensDiameter() const
Definition: SLCamera.h:149
SLBackground _background
Colors or texture displayed in the background.
Definition: SLCamera.h:198
SLbool onKeyRelease(SLKey key, SLKey mod) override
Definition: SLCamera.cpp:1470
SLfloat trackballSize() const
Definition: SLCamera.h:164
SLfloat _unitScaling
indicate what the current unit scale is
Definition: SLCamera.h:224
void lensSamples(SLuint x, SLuint y)
Definition: SLCamera.h:118
SLfloat _stereoEyeSeparation
eye separation for stereo mode
Definition: SLCamera.h:223
SLfloat _cy
sensor center in y direction
Definition: SLCamera.h:197
SLfloat maxSpeed() const
Definition: SLCamera.h:166
void buildAABB(SLAABBox &aabb, const SLMat4f &wmNode)
Definition: SLCamera.cpp:397
SLfloat clipNear() const
Definition: SLCamera.h:140
void setViewport(SLSceneView *sv, SLEyeType eye)
Sets the viewport transform depending on the projection.
Definition: SLCamera.cpp:459
SLfloat _cx
sensor center in x direction
Definition: SLCamera.h:196
static SLProjType currentProjection
Definition: SLCamera.h:179
SLstring toString() const
SLCamera::to_string returns important camera parameter as a string.
Definition: SLCamera.cpp:1646
SLfloat clipFar() const
Definition: SLCamera.h:141
static SLint currentDevRotation
Definition: SLCamera.h:181
SLfloat _fovV
Current vertical field of view (view angle) in degrees.
Definition: SLCamera.h:187
SLMat3f _enucorrRenu
Definition: SLCamera.h:246
SLbool onMouseUp(SLMouseButton button, SLint x, SLint y, SLKey mod) override
Gets called whenever the mouse button is released.
Definition: SLCamera.cpp:1207
void preShade(SLRay *ray)
Definition: SLCamera.h:62
SLRecti _viewport
framebuffer rectangle
Definition: SLCamera.h:192
void stereoEyeSeparation(const SLfloat es)
Definition: SLCamera.h:119
SLfloat fovV() const
Vertical field of view.
Definition: SLCamera.h:135
void clipFar(const SLfloat cFar)
Definition: SLCamera.h:109
SLfloat fovH() const
Horizontal field of view.
Definition: SLCamera.cpp:1504
SLfloat fogDistStart() const
Definition: SLCamera.h:160
void clipNear(const SLfloat cNear)
Definition: SLCamera.h:108
SLfloat brakeAccel() const
Definition: SLCamera.h:168
SLchar _keyStates[256]
Stores for all movement keys whether they are pressed.
Definition: SLCamera.h:209
SLfloat _clipNear
Dist. to the near clipping plane.
Definition: SLCamera.h:189
SLVec2f projectWorldToNDC(const SLVec4f &worldPos) const
Project a world position into screen coordinates.
Definition: SLCamera.cpp:1601
SLstring projTypeStr() const
Definition: SLCamera.h:133
SLVec3f trackballVec(SLint x, SLint y) const
Returns a vector from the window center to a virtual trackball at [x,y].
Definition: SLCamera.cpp:1665
void devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
Definition: SLCamera.h:120
void focalDist(const SLfloat f)
Definition: SLCamera.h:116
SLCamera(const SLstring &name="Camera")
Construct a new SLCamera::SLCamera object.
Definition: SLCamera.cpp:33
SLfloat moveAccel() const
Definition: SLCamera.h:167
SLfloat _lensDiameter
Lens diameter.
Definition: SLCamera.h:219
SLfloat _maxSpeed
maximum speed in m/s, with high drag values this speed might not be achievable at all
Definition: SLCamera.h:211
SLfloat _fovInit
Initial vertical field of view (view angle) in degrees.
Definition: SLCamera.h:188
void maxSpeed(const SLfloat ms)
Definition: SLCamera.h:112
void passToUniforms(SLGLProgram *program)
Pass camera parameters to the uniform variables.
Definition: SLCamera.cpp:1688
void fogMode(const SLFogMode mode)
Definition: SLCamera.h:126
SLbool _fogIsOn
Flag if fog blending is enabled.
Definition: SLCamera.h:229
SLfloat fogDensity() const
Definition: SLCamera.h:159
SLbool onMouseMove(SLMouseButton button, SLint x, SLint y, SLKey mod) override
Gets called whenever the mouse is moved.
Definition: SLCamera.cpp:1031
SLfloat _fogDensity
Fog density for exponential modes.
Definition: SLCamera.h:231
SLVec3f focalPointWS() const
Definition: SLCamera.h:154
SLGLVertexArrayExt _vao
OpenGL Vertex array for rendering.
Definition: SLCamera.h:200
SLCol4f fogColor() const
Definition: SLCamera.h:162
SLfloat _clipFar
Dist. to the far clipping plane.
Definition: SLCamera.h:190
void setView(SLSceneView *sv, SLEyeType eye)
Definition: SLCamera.cpp:719
SLfloat unitScaling() const
Definition: SLCamera.h:134
SLRecti viewport() const
Definition: SLCamera.h:138
SLVec2f _oldTouchPos1
Old mouse/touch position in pixels.
Definition: SLCamera.h:204
void projType(SLProjType p)
Definition: SLCamera.h:92
~SLCamera() override
Definition: SLCamera.cpp:90
SLPlane _plane[6]
6 frustum planes (l, r, t, b, n, f)
Definition: SLCamera.h:191
void brakeAccel(const SLfloat accel)
Definition: SLCamera.h:114
void lensDiameter(const SLfloat d)
Definition: SLCamera.h:117
SLfloat _fogStart
Fog start distance for linear mode.
Definition: SLCamera.h:232
SLfloat focalDistScrH() const
Definition: SLCamera.cpp:444
void eyeToPixelRay(SLfloat x, SLfloat y, SLRay *ray)
eyeToPixelRay returns the a ray from the eye to the center of a pixel.
Definition: SLCamera.cpp:1514
SLfloat _focalDist
distance to lookAt point on the focal plane from lens
Definition: SLCamera.h:218
SLfloat _trackballSize
Size of trackball (0.8 = 80% of window size)
Definition: SLCamera.h:207
SLDeviceRotation * _devRot
Definition: SLCamera.h:237
static SLstring projTypeToStr(SLProjType pt)
Returns the projection type as string.
Definition: SLCamera.cpp:419
SLVec3f _acceleration
current acceleration vector
Definition: SLCamera.h:213
SLRectf _deselectRect
Mouse deselection rectangle. See SLMesh::handleRectangleSelection.
Definition: SLCamera.h:241
SLVec2f _oldTouchPos2
Old 2nd finger touch position in pixels.
Definition: SLCamera.h:205
void drag(const SLfloat drag)
Definition: SLCamera.h:115
SLfloat _moveAccel
move acceleration
Definition: SLCamera.h:215
SLCamAnim camAnim() const
Definition: SLCamera.h:142
SLVec3f focalPointOS() const
Definition: SLCamera.h:155
SLstring animationStr() const
SLCamera::animationStr() returns the animation enum as string.
Definition: SLCamera.cpp:983
void statsRec(SLNodeStats &stats) override
SLCamera::statsRec updates the statistic parameters.
Definition: SLCamera.cpp:348
SLVec2f frustumSizeAtDistance(SLfloat distance)
Calculate and return frustum size at distance to camera center.
Definition: SLCamera.cpp:408
SLCamAnim _camAnim
did the camera updateRec in the last frame?
Definition: SLCamera.h:203
SLint _xOffsetPix
parameter for manual finger rotation and translation
Definition: SLCamera.h:244
SLRectf & deselectRect()
Definition: SLCamera.h:172
SLbool _fogColorIsBack
fog color blended to the final color
Definition: SLCamera.h:235
SLVec3f _trackballStartVec
Trackball vector at mouse down.
Definition: SLCamera.h:206
virtual SLbool camUpdate(SLSceneView *sv, SLfloat timeMS)
Definition: SLCamera.cpp:98
void moveAccel(const SLfloat accel)
Definition: SLCamera.h:113
void setFrustumPlanes()
SLCamera::setFrustumPlanes set the 6 plane from the view frustum.
Definition: SLCamera.cpp:1495
SLfloat focalDistScrW() const
Definition: SLCamera.cpp:453
SLfloat _viewportRatio
viewport.width / viewport.height = screen ratio
Definition: SLCamera.h:193
void fogIsOn(const bool isOn)
Definition: SLCamera.h:125
void onCamUpdateCB(function< void(SLSceneView *sv)> callbackFunc)
Definition: SLCamera.h:128
SLint stereoEye() const
Definition: SLCamera.h:146
function< void(SLSceneView *sv)> _onCamUpdateCB
Definition: SLCamera.h:248
SLBackground & background()
Definition: SLCamera.h:165
SLRectf & selectRect()
Definition: SLCamera.h:171
void fov(const SLfloat fov)
vertical field of view
Definition: SLCamera.h:98
SLbool isInFrustum(SLAABBox *aabb)
SLCamera::isInFrustum does a simple and fast frustum culling test for AABBs.
Definition: SLCamera.cpp:1625
SLCol4f _fogColor
fog color blended to the final color
Definition: SLCamera.h:234
SLbool fogIsOn() const
Definition: SLCamera.h:157
SLbool onTouch2Up(SLint x1, SLint y1, SLint x2, SLint y2) override
Definition: SLCamera.cpp:1412
void updateEnuCorrRenu(SLSceneView *sv, const SLMat3f &enuRc, float &f, SLVec3f &enuOffsetPix)
Calculate and apply correction from finger x-y-rotation.
Definition: SLCamera.cpp:641
SLint _stereoEye
-1=left, 0=center, 1=right
Definition: SLCamera.h:225
void drawMesh(SLSceneView *sv) override
SLCamera::drawMeshes draws the cameras frustum lines.
Definition: SLCamera.cpp:188
SLbool onMouseDown(SLMouseButton button, SLint x, SLint y, SLKey mod) override
Gets called whenever a mouse button gets pressed.
Definition: SLCamera.cpp:1005
void lookFrom(const SLVec3f &fromDir, const SLVec3f &upDir=SLVec3f::AXISY)
Sets the view to look from a direction towards the current focal point.
Definition: SLCamera.cpp:974
SLMat3f stereoColorFilter() const
Definition: SLCamera.h:147
void setProjection(SLSceneView *sv, SLEyeType eye)
Definition: SLCamera.cpp:513
void fogDensity(const float density)
Definition: SLCamera.h:127
SLMat3f _stereoColorFilter
color filter matrix for anaglyphling is to adjust movement and stereo rendering correctly
Definition: SLCamera.h:226
static SLfloat currentFOV
Definition: SLCamera.h:180
SLfloat fogDistEnd() const
Definition: SLCamera.h:161
SLfloat _brakeAccel
brake acceleration
Definition: SLCamera.h:214
SLbool onTouch2Move(SLint x1, SLint y1, SLint x2, SLint y2) override
Definition: SLCamera.cpp:1295
SLfloat _fy
vertical focal length
Definition: SLCamera.h:195
SLfloat aspect() const
Definition: SLCamera.h:139
static SLCamAnim currentAnimation
Definition: SLCamera.h:178
SLbool onKeyPress(SLKey key, SLKey mod) override
Definition: SLCamera.cpp:1425
SLfloat stereoEyeSeparation() const
Definition: SLCamera.h:145
const SLMat4f & updateAndGetVM() const
Definition: SLCamera.h:131
SLVec3f _velocity
current velocity vector
Definition: SLCamera.h:212
SLProjType projType() const
Definition: SLCamera.h:132
SLint _yOffsetPix
Definition: SLCamera.h:245
SLFogMode fogMode() const
Definition: SLCamera.h:158
SLProjType _projType
Projection type.
Definition: SLCamera.h:186
void UVWFrame(SLVec3f &EYE, SLVec3f &U, SLVec3f &V, SLVec3f &W)
Definition: SLCamera.cpp:1578
SLbool onMouseWheel(SLint delta, SLKey mod) override
Definition: SLCamera.cpp:1243
SLRectf _selectRect
Mouse selection rectangle. See SLMesh::handleRectangleSelection.
Definition: SLCamera.h:240
void calcMinMax(SLVec3f &minV, SLVec3f &maxV) const
Definition: SLCamera.cpp:359
SLfloat drag() const
Definition: SLCamera.h:169
SLbool _movedLastFrame
Definition: SLCamera.h:202
void camAnim(SLCamAnim ca)
Definition: SLCamera.h:103
SLfloat _fogEnd
Fog end distance for linear mode.
Definition: SLCamera.h:233
Encapsulation of a mobile device location set by the device's GPS sensor.
Encapsulation of a mobile device rotation set by the device's IMU sensor.
Encapsulation of an OpenGL shader program object.
Definition: SLGLProgram.h:56
SLGLVertexArray adds Helper Functions for quick Line & Point Drawing.
SLNode represents a node in a hierarchical scene graph.
Definition: SLNode.h:147
SLAABBox * aabb()
Definition: SLNode.h:301
SLVec3f forwardOS() const
Definition: SLNode.h:477
SLVec3f translationWS() const
Definition: SLNode.h:531
SLVec3f translationOS() const
Definition: SLNode.h:468
const SLMat4f & updateAndGetWMI() const
Definition: SLNode.cpp:714
SLVec3f forwardWS() const
Definition: SLNode.h:541
const SLstring & name() const
Definition: SLObject.h:38
Defines a plane in 3D space with the equation ax + by + cy + d = 0.
Definition: SLPlane.h:25
Ray class with ray and intersection properties.
Definition: SLRay.h:40
Class for 2D disk sample points.
void samples(SLuint x, SLuint y, SLbool evenlyDistributed=true)
Resets the sample point array by the sqrt of the no. of samples.
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69
static SLVec3 AXISY
Definition: SLVec3.h:298
T mod(T a, T b)
Definition: Utils.h:250
Struct for scene graph statistics.
Definition: SLNode.h:37