56 nc( { 0.0, 0.0, 0.0 } ),
57 fc( { 0.0, 0.0, 0.0 } ),
58 ntl( { 0.0, 0.0, 0.0 } ),
59 ntr( { 0.0, 0.0, 0.0 } ),
60 nbl( { 0.0, 0.0, 0.0 } ),
61 nbr( { 0.0, 0.0, 0.0 } ),
62 ftl( { 0.0, 0.0, 0.0 } ),
63 ftr( { 0.0, 0.0, 0.0 } ),
64 fbl( { 0.0, 0.0, 0.0 } ),
65 fbr( { 0.0, 0.0, 0.0 } ),
104 explicit CAMERA(
float aInitialDistance );
116 glm::mat4 GetRotationMatrix()
const;
118 const glm::mat4& GetViewMatrix()
const;
119 const glm::mat4& GetViewMatrix_Inv()
const;
121 const glm::mat4& GetProjectionMatrix()
const;
122 const glm::mat4& GetProjectionMatrixInv()
const;
140 void SetRotationMatrix(
const glm::mat4& aRotation );
149 void SetViewMatrix( glm::mat4 aViewMatrix );
151 void SetBoardLookAtPos(
const SFVEC3F& aBoardPos );
163 float GetCameraMinDimension()
const;
168 virtual void Drag(
const wxPoint& aNewMousePosition ) = 0;
170 virtual void Pan(
const wxPoint& aNewMousePosition ) = 0;
179 virtual void Reset();
193 void SetCurMousePosition(
const wxPoint& aPosition );
195 void ToggleProjection();
204 bool SetCurWindowSize(
const wxSize& aSize );
208 bool Zoom(
float aFactor );
210 bool Zoom_T1(
float aFactor );
233 void RotateScreen(
float aAngleInRadians );
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 );
263 bool ParametersChanged();
295 void MakeRayAtCurrentMousePosition(
SFVEC3F& aOutOrigin,
SFVEC3F& aOutDirection )
const;
304 void rebuildProjection();
305 void updateFrustum();
306 void updateViewMatrix();
308 void updateRotationMatrix();
declared enumerations and flags
PROJECTION_TYPE
Camera projection types.
Generic cubic Bezier representation.
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
CAMERA(float aInitialDistance)
Initialize a camera.
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.