64 nc( { 0.0, 0.0, 0.0 } ),
65 fc( { 0.0, 0.0, 0.0 } ),
66 ntl( { 0.0, 0.0, 0.0 } ),
67 ntr( { 0.0, 0.0, 0.0 } ),
68 nbl( { 0.0, 0.0, 0.0 } ),
69 nbr( { 0.0, 0.0, 0.0 } ),
70 ftl( { 0.0, 0.0, 0.0 } ),
71 ftr( { 0.0, 0.0, 0.0 } ),
72 fbl( { 0.0, 0.0, 0.0 } ),
73 fbr( { 0.0, 0.0, 0.0 } ),
112 explicit CAMERA(
float aInitialDistance );
123 glm::mat4 GetRotationMatrix()
const;
125 const glm::mat4& GetViewMatrix()
const;
126 const glm::mat4& GetViewMatrix_Inv()
const;
128 const glm::mat4& GetProjectionMatrix()
const;
129 const glm::mat4& GetProjectionMatrixInv()
const;
136 float GetNear()
const {
return m_frustum.nearD; }
137 float GetFar()
const {
return m_frustum.farD; }
147 void SetRotationMatrix(
const glm::mat4& aRotation );
156 void SetViewMatrix( glm::mat4 aViewMatrix );
158 void SetBoardLookAtPos(
const SFVEC3F& aBoardPos );
162 m_lookat_pos_t1 = aLookAtPos;
170 float GetCameraMinDimension()
const;
175 virtual void Drag(
const wxPoint& aNewMousePosition ) = 0;
177 virtual void Pan(
const wxPoint& aNewMousePosition ) = 0;
186 virtual void Reset();
187 virtual void Reset_T1();
190 void ResetXYpos_T1();
200 void SetCurMousePosition(
const wxPoint& aPosition );
202 void ToggleProjection();
211 bool SetCurWindowSize(
const wxSize& aSize );
215 bool Zoom(
float aFactor );
217 bool Zoom_T1(
float aFactor );
235 void RotateX(
float aAngleInRadians );
236 void RotateY(
float aAngleInRadians );
237 void RotateZ(
float aAngleInRadians );
239 void RotateX_T1(
float aAngleInRadians );
240 void RotateY_T1(
float aAngleInRadians );
241 void RotateZ_T1(
float aAngleInRadians );
246 virtual void SetT0_and_T1_current_T();
253 virtual void Interpolate(
float t );
257 m_interpolation_mode = aInterpolateMode;
263 bool ParametersChanged();
295 void MakeRayAtCurrentMousePosition(
SFVEC3F& aOutOrigin,
SFVEC3F& aOutDirection )
const;
304 void rebuildProjection();
305 void updateFrustum();
306 void updateViewMatrix();
308 void updateRotationMatrix();
A class used to derive camera objects from.
const SFVEC3F & GetRight() const
bool m_parametersChanged
Set to true if any of the parameters in the camera was changed.
glm::mat4 m_projectionMatrixInv
const CAMERA_FRUSTUM & GetFrustum() const
bool ParametersChangedQuery() const
void SetMinZoom(float minZoom)
void SetProjection(PROJECTION_TYPE aProjection)
const SFVEC3F & GetPos() const
virtual void Pan(const wxPoint &aNewMousePosition)=0
glm::mat4 m_projectionMatrix
CAMERA_INTERPOLATION m_interpolation_mode
wxPoint m_lastPosition
The last mouse position in the screen.
PROJECTION_TYPE GetProjection()
static const float DEFAULT_MIN_ZOOM
static const float DEFAULT_MAX_ZOOM
virtual void Pan_T1(const SFVEC3F &aDeltaOffsetInc)=0
const SFVEC3F & GetUp() const
virtual void Drag(const wxPoint &aNewMousePosition)=0
Calculate a new mouse drag position.
void SetInterpolateMode(CAMERA_INTERPOLATION aInterpolateMode)
SFVEC3F m_camera_pos_init
float m_minZoom
Possible 3D zoom range.
virtual void Pan(const SFVEC3F &aDeltaOffsetInc)=0
const SFVEC3F & GetLookAtPos() const
std::vector< SFVEC3F > m_right_nX
Precalc values array used to calc ray for each pixel, for X and Y axis of each new camera position.
const SFVEC2F & GetFocalLen() const
PROJECTION_TYPE m_projectionType
SFVEC2I m_windowSize
The window size that this camera is working.
std::vector< float > m_scr_nX
Precalc values array used to calc ray for each pixel (constant for the same window size).
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
glm::mat4 m_viewMatrixInverse
const SFVEC3F & GetLookAtPos_T1() const
const wxPoint & GetCurMousePosition()
Get the current mouse position.
const SFVEC3F & GetCameraPos() const
const SFVEC3F & GetDir() const
SFVEC3F m_rotate_aux
Stores the rotation angle auxiliary.
glm::mat4 m_rotationMatrixAux
glm::mat4 m_rotationMatrix
std::vector< float > m_scr_nY
void SetMaxZoom(float maxZoom)
SFVEC3F m_board_lookat_pos_init
Default boardlookat position (the board center).
const SFVEC3F & GetCameraInitPos() const
std::vector< SFVEC3F > m_up_nY
float m_zoom
3D zoom value – Z-distance is scaled by it
void Update()
Update the camera.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
Frustum is a implementation based on a tutorial by http://www.lighthouse3d.com/tutorials/view-frustum...
SFVEC3F ntr
Near Top Right.
SFVEC3F ntl
Near Top Left.
SFVEC3F fbr
Far Bottom Right.
SFVEC3F nbl
Near Bottom Left.
SFVEC3F nbr
Near Bottom Right.
SFVEC3F fbl
Far Bottom Left.
SFVEC3F ftr
Far Top Right.