27 class SLCameraAnimation;
SLCamAnim
Enumeration for available camera animation types.
SLProjType
Enumeration for different camera projections.
SLMouseButton
Mouse button codes.
SLFogMode
Corresponds to the old fog modes in OpenGL 2.1.
SLEyeType
Enumeration for stereo eye type used for camera projection.
SLKey
Keyboard key codes enumeration.
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
Defines an axis aligned bounding box.
Defines a 2D-Background for the OpenGL framebuffer background.
Active or visible camera node class.
SLfloat _drag
simple constant drag that affects velocity
SLRaySamples2D _lensSamples
sample points for lens sampling (DOF)
SLFogMode _fogMode
0=LINEAR, 1=EXP, 2=EXP2
SLbool onTouch2Down(SLint x1, SLint y1, SLint x2, SLint y2) override
SLDeviceLocation * _devLoc
SLRaySamples2D * lensSamples()
SLfloat focalDist() const
SLfloat _fx
horizontal focal length
SLfloat lensDiameter() const
SLBackground _background
Colors or texture displayed in the background.
SLbool onKeyRelease(SLKey key, SLKey mod) override
SLfloat trackballSize() const
SLfloat _unitScaling
indicate what the current unit scale is
void lensSamples(SLuint x, SLuint y)
SLfloat _stereoEyeSeparation
eye separation for stereo mode
SLfloat _cy
sensor center in y direction
void buildAABB(SLAABBox &aabb, const SLMat4f &wmNode)
void setViewport(SLSceneView *sv, SLEyeType eye)
Sets the viewport transform depending on the projection.
SLfloat _cx
sensor center in x direction
static SLProjType currentProjection
SLstring toString() const
SLCamera::to_string returns important camera parameter as a string.
static SLint currentDevRotation
SLfloat _fovV
Current vertical field of view (view angle) in degrees.
SLbool onMouseUp(SLMouseButton button, SLint x, SLint y, SLKey mod) override
Gets called whenever the mouse button is released.
void preShade(SLRay *ray)
SLRecti _viewport
framebuffer rectangle
void stereoEyeSeparation(const SLfloat es)
SLfloat fovV() const
Vertical field of view.
void clipFar(const SLfloat cFar)
SLfloat fovH() const
Horizontal field of view.
SLfloat fogDistStart() const
void clipNear(const SLfloat cNear)
SLfloat brakeAccel() const
SLchar _keyStates[256]
Stores for all movement keys whether they are pressed.
SLfloat _clipNear
Dist. to the near clipping plane.
SLVec2f projectWorldToNDC(const SLVec4f &worldPos) const
Project a world position into screen coordinates.
SLstring projTypeStr() const
SLVec3f trackballVec(SLint x, SLint y) const
Returns a vector from the window center to a virtual trackball at [x,y].
void devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLCamera(const SLstring &name="Camera")
Construct a new SLCamera::SLCamera object.
SLfloat moveAccel() const
SLfloat _lensDiameter
Lens diameter.
SLfloat _maxSpeed
maximum speed in m/s, with high drag values this speed might not be achievable at all
SLfloat _fovInit
Initial vertical field of view (view angle) in degrees.
void maxSpeed(const SLfloat ms)
void passToUniforms(SLGLProgram *program)
Pass camera parameters to the uniform variables.
void fogMode(const SLFogMode mode)
SLbool _fogIsOn
Flag if fog blending is enabled.
SLfloat fogDensity() const
SLbool onMouseMove(SLMouseButton button, SLint x, SLint y, SLKey mod) override
Gets called whenever the mouse is moved.
SLfloat _fogDensity
Fog density for exponential modes.
SLVec3f focalPointWS() const
SLGLVertexArrayExt _vao
OpenGL Vertex array for rendering.
SLfloat _clipFar
Dist. to the far clipping plane.
void setView(SLSceneView *sv, SLEyeType eye)
SLfloat unitScaling() const
SLVec2f _oldTouchPos1
Old mouse/touch position in pixels.
void projType(SLProjType p)
SLPlane _plane[6]
6 frustum planes (l, r, t, b, n, f)
void brakeAccel(const SLfloat accel)
void lensDiameter(const SLfloat d)
SLfloat _fogStart
Fog start distance for linear mode.
SLfloat focalDistScrH() const
void eyeToPixelRay(SLfloat x, SLfloat y, SLRay *ray)
eyeToPixelRay returns the a ray from the eye to the center of a pixel.
SLfloat _focalDist
distance to lookAt point on the focal plane from lens
SLfloat _trackballSize
Size of trackball (0.8 = 80% of window size)
SLDeviceRotation * _devRot
static SLstring projTypeToStr(SLProjType pt)
Returns the projection type as string.
SLVec3f _acceleration
current acceleration vector
SLRectf _deselectRect
Mouse deselection rectangle. See SLMesh::handleRectangleSelection.
SLVec2f _oldTouchPos2
Old 2nd finger touch position in pixels.
void drag(const SLfloat drag)
SLfloat _moveAccel
move acceleration
SLCamAnim camAnim() const
SLVec3f focalPointOS() const
SLstring animationStr() const
SLCamera::animationStr() returns the animation enum as string.
void statsRec(SLNodeStats &stats) override
SLCamera::statsRec updates the statistic parameters.
SLVec2f frustumSizeAtDistance(SLfloat distance)
Calculate and return frustum size at distance to camera center.
SLCamAnim _camAnim
did the camera updateRec in the last frame?
SLint _xOffsetPix
parameter for manual finger rotation and translation
SLbool _fogColorIsBack
fog color blended to the final color
SLVec3f _trackballStartVec
Trackball vector at mouse down.
virtual SLbool camUpdate(SLSceneView *sv, SLfloat timeMS)
void moveAccel(const SLfloat accel)
void setFrustumPlanes()
SLCamera::setFrustumPlanes set the 6 plane from the view frustum.
SLfloat focalDistScrW() const
SLfloat _viewportRatio
viewport.width / viewport.height = screen ratio
void fogIsOn(const bool isOn)
void onCamUpdateCB(function< void(SLSceneView *sv)> callbackFunc)
function< void(SLSceneView *sv)> _onCamUpdateCB
SLBackground & background()
void fov(const SLfloat fov)
vertical field of view
SLbool isInFrustum(SLAABBox *aabb)
SLCamera::isInFrustum does a simple and fast frustum culling test for AABBs.
SLCol4f _fogColor
fog color blended to the final color
SLbool onTouch2Up(SLint x1, SLint y1, SLint x2, SLint y2) override
void updateEnuCorrRenu(SLSceneView *sv, const SLMat3f &enuRc, float &f, SLVec3f &enuOffsetPix)
Calculate and apply correction from finger x-y-rotation.
SLint _stereoEye
-1=left, 0=center, 1=right
void drawMesh(SLSceneView *sv) override
SLCamera::drawMeshes draws the cameras frustum lines.
SLbool onMouseDown(SLMouseButton button, SLint x, SLint y, SLKey mod) override
Gets called whenever a mouse button gets pressed.
void lookFrom(const SLVec3f &fromDir, const SLVec3f &upDir=SLVec3f::AXISY)
Sets the view to look from a direction towards the current focal point.
SLMat3f stereoColorFilter() const
void setProjection(SLSceneView *sv, SLEyeType eye)
void fogDensity(const float density)
SLMat3f _stereoColorFilter
color filter matrix for anaglyphling is to adjust movement and stereo rendering correctly
static SLfloat currentFOV
SLfloat fogDistEnd() const
SLfloat _brakeAccel
brake acceleration
SLbool onTouch2Move(SLint x1, SLint y1, SLint x2, SLint y2) override
SLfloat _fy
vertical focal length
static SLCamAnim currentAnimation
SLbool onKeyPress(SLKey key, SLKey mod) override
SLfloat stereoEyeSeparation() const
const SLMat4f & updateAndGetVM() const
SLVec3f _velocity
current velocity vector
SLProjType projType() const
SLFogMode fogMode() const
SLProjType _projType
Projection type.
void UVWFrame(SLVec3f &EYE, SLVec3f &U, SLVec3f &V, SLVec3f &W)
SLbool onMouseWheel(SLint delta, SLKey mod) override
SLRectf _selectRect
Mouse selection rectangle. See SLMesh::handleRectangleSelection.
void calcMinMax(SLVec3f &minV, SLVec3f &maxV) const
void camAnim(SLCamAnim ca)
SLfloat _fogEnd
Fog end distance for linear mode.
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.
SLGLVertexArray adds Helper Functions for quick Line & Point Drawing.
SLNode represents a node in a hierarchical scene graph.
SLVec3f forwardOS() const
SLVec3f translationWS() const
SLVec3f translationOS() const
const SLMat4f & updateAndGetWMI() const
SLVec3f forwardWS() const
const SLstring & name() const
Defines a plane in 3D space with the equation ax + by + cy + d = 0.
Ray class with ray and intersection properties.
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.
Struct for scene graph statistics.