Nebula
Loading...
Searching...
No Matches
mayacamerautil.h
Go to the documentation of this file.
1#pragma once
2#ifndef RENDERUTIL_MAYACAMERAUTIL_H
3#define RENDERUTIL_MAYACAMERAUTIL_H
4//------------------------------------------------------------------------------
16#include "math/mat4.h"
17#include "math/vec2.h"
18#include "math/polar.h"
19#include "math/scalar.h"
20
21//------------------------------------------------------------------------------
22namespace RenderUtil
23{
90
91//------------------------------------------------------------------------------
94inline void
96{
97 this->orbitButton = b;
98}
99
100//------------------------------------------------------------------------------
103inline void
105{
106 this->panButton = b;
107}
108
109//------------------------------------------------------------------------------
112inline void
114{
115 this->zoomButton = b;
116}
117
118//------------------------------------------------------------------------------
121inline void
123{
124 this->zoomInButton = b;
125}
126
127//------------------------------------------------------------------------------
130inline void
132{
133 this->zoomOutButton = b;
134}
135
136//------------------------------------------------------------------------------
139inline void
144
145//------------------------------------------------------------------------------
148inline const Math::mat4&
150{
151 return this->cameraTransform;
152}
153
154//------------------------------------------------------------------------------
157inline const Math::scalar&
159{
160 return this->viewDistance;
161}
162
163//------------------------------------------------------------------------------
166inline const Math::point&
168{
169 return this->centerOfInterest;
170}
171
172//------------------------------------------------------------------------------
175inline void
177{
178 this->zoomIn = v;
179}
180
181//------------------------------------------------------------------------------
184inline void
186{
187 this->zoomOut = v;
188}
189
190//------------------------------------------------------------------------------
193inline void
195{
196 this->panning = v;
197}
198
199//------------------------------------------------------------------------------
202inline void
204{
205 this->orbiting = v;
206}
207
208//------------------------------------------------------------------------------
211inline void
216
217//------------------------------------------------------------------------------
220inline void
222{
223 this->viewDistance = distance;
224}
225
226} // namespace RenderUtil
227//------------------------------------------------------------------------------
228#endif
A polar coordinate inline class, consisting of 2 angles theta (latitude) and rho (longitude).
Definition polar.h:28
Helper class to implement a "Maya camera" with pan/zoom/orbit.
Definition mayacamerautil.h:25
Math::mat4 cameraTransform
Definition mayacamerautil.h:77
void SetZoomButton(bool b)
set state of zoom button
Definition mayacamerautil.h:113
Math::vec2 mouseMovement
Definition mayacamerautil.h:84
void Setup(const Math::point &defaultCenterOfInterest, const Math::point &defaultEyePos, const Math::vector &defaultUpVec)
setup the object
Definition mayacamerautil.cc:41
void SetZoomOutButton(bool b)
set state of zoom-out button
Definition mayacamerautil.h:131
const Math::point & GetCenterOfInterest() const
get center of interest
Definition mayacamerautil.h:167
MayaCameraUtil()
constructor
Definition mayacamerautil.cc:16
void SetCenterOfInterest(const Math::point &point)
set center of interest
Definition mayacamerautil.h:212
void SetOrbitButton(bool b)
set state of orbit button
Definition mayacamerautil.h:95
void SetPanning(const Math::vec2 &v)
set panning vector
Definition mayacamerautil.h:194
float zoomOut
Definition mayacamerautil.h:86
bool zoomOutButton
Definition mayacamerautil.h:83
bool panButton
Definition mayacamerautil.h:80
void Reset()
reset the object to its default settings
Definition mayacamerautil.cc:53
void SetOrbiting(const Math::vec2 &v)
set orbiting vector
Definition mayacamerautil.h:203
Math::scalar viewDistance
Definition mayacamerautil.h:74
Math::point centerOfInterest
Definition mayacamerautil.h:75
void SetMouseMovement(const Math::vec2 &v)
set mouse movement
Definition mayacamerautil.h:140
Math::point defaultEyePos
Definition mayacamerautil.h:70
Math::vec2 orbiting
Definition mayacamerautil.h:88
void SetZoomOut(float v)
set zoom-out value
Definition mayacamerautil.h:185
bool zoomInButton
Definition mayacamerautil.h:82
void SetZoomIn(float v)
set zoom-in value
Definition mayacamerautil.h:176
const Math::mat4 & GetCameraTransform() const
get the current camera transform
Definition mayacamerautil.h:149
float zoomIn
Definition mayacamerautil.h:85
bool zoomButton
Definition mayacamerautil.h:81
void SetViewDistance(const Math::scalar &distance)
set view distance
Definition mayacamerautil.h:221
Math::vec2 panning
Definition mayacamerautil.h:87
Math::point defaultCenterOfInterest
Definition mayacamerautil.h:69
Math::vector defaultUpVec
Definition mayacamerautil.h:71
void SetZoomInButton(bool b)
set state of zoom-in button
Definition mayacamerautil.h:122
void SetPanButton(bool b)
set state of panning button
Definition mayacamerautil.h:104
bool orbitButton
Definition mayacamerautil.h:79
Math::polar viewAngles
Definition mayacamerautil.h:73
const Math::scalar & GetViewDistance() const
get view distance
Definition mayacamerautil.h:158
float scalar
Definition scalar.h:45
Helpers to create geometry.
Definition drawfullscreenquad.cc:10
@ Update
Definition resourceloader.h:53
Nebula's scalar datatype.
A 4x4 single point precision float matrix.
Definition mat4.h:49
Represents a 3D point in space.
Definition point.h:22
A 2-component float vector class.
Definition vec2.h:21
A vector is a 3D direction in space.
Definition vector.h:22