33 #include "../3d_rendering/raytracing/ray.h" 34 #include <wx/gdicmn.h> 85 explicit CAMERA(
float aInitialDistance );
138 virtual void Drag(
const wxPoint& aNewMousePosition ) = 0;
140 virtual void Pan(
const wxPoint& aNewMousePosition ) = 0;
142 virtual void Pan(
const SFVEC3F& aDeltaOffsetInc ) = 0;
149 virtual void Reset();
173 bool Zoom(
float aFactor );
193 void RotateX(
float aAngleInRadians );
194 void RotateY(
float aAngleInRadians );
195 void RotateZ(
float aAngleInRadians );
SFVEC3F fbl
Far Bottom Left.
void SetMinZoom(float minZoom)
void RotateX(float aAngleInRadians)
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
virtual void Pan(const wxPoint &aNewMousePosition)=0
glm::mat4 m_viewMatrixInverse
SFVEC3F m_rotate_aux
Stores the rotation angle auxiliary.
void SetBoardLookAtPos(const SFVEC3F &aBoardPos)
void RotateZ_T1(float aAngleInRadians)
float m_zoom
3D zoom value – Z-distance is scaled by it
bool Zoom_T1(float aFactor)
PROJECTION_TYPE GetProjection()
virtual void Pan_T1(const SFVEC3F &aDeltaOffsetInc)=0
const glm::mat4 & GetViewMatrix_Inv() const
bool m_parametersChanged
Set to true if any of the parameters in the camera was changed.
CAMERA(float aInitialDistance)
Initialize a camera.
const SFVEC3F & GetCameraInitPos() const
const glm::mat4 & GetProjectionMatrix() const
const SFVEC3F & GetLookAtPos_T1() const
virtual void SetLookAtPos(const SFVEC3F &aLookAtPos)=0
bool ParametersChangedQuery() const
void RotateY_T1(float aAngleInRadians)
const SFVEC3F & GetPos() const
const SFVEC3F & GetRight() const
virtual void Reset()
Reset the camera to initial state.
SFVEC3F nbr
Near Bottom Right.
const glm::mat4 GetRotationMatrix() const
Get the rotation matrix to be applied in a transformation camera.
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.
virtual void Drag(const wxPoint &aNewMousePosition)=0
Calculate a new mouse drag position.
SFVEC3F fbr
Far Bottom Right.
SFVEC3F m_camera_pos_init
float GetCameraMinDimension() const
A class used to derive camera objects from.
Frustum is a implementation based on a tutorial by http://www.lighthouse3d.com/tutorials/view-frustum...
PROJECTION_TYPE m_projectionType
SFVEC3F nbl
Near Bottom Left.
wxPoint m_lastPosition
The last mouse position in the screen.
void updateRotationMatrix()
const glm::mat4 & GetViewMatrix() const
void RotateY(float aAngleInRadians)
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on a windows screen position.
void SetCurMousePosition(const wxPoint &aPosition)
Update the current mouse position without make any new calculations on camera.
const glm::mat4 & GetProjectionMatrixInv() const
glm::mat4 m_rotationMatrix
void MakeRayAtCurrrentMousePosition(SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on the latest mouse position.
SFVEC2I m_windowSize
The window size that this camera is working.
glm::mat4 m_projectionMatrix
CAMERA_INTERPOLATION m_interpolation_mode
void SetInterpolateMode(CAMERA_INTERPOLATION aInterpolateMode)
SFVEC3F m_board_lookat_pos_init
Default boardlookat position (the board center).
bool SetCurWindowSize(const wxSize &aSize)
Update the windows size of the camera.
float m_minZoom
Possible 3D zoom range.
std::vector< SFVEC3F > m_up_nY
const SFVEC3F & GetDir() const
const SFVEC3F & GetUp() const
virtual void SetT0_and_T1_current_T()
This will set T0 and T1 with the current values.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
virtual void Interpolate(float t)
It will update the matrix to interpolate between T0 and T1 values.
SFVEC3F ntl
Near Top Left.
void RotateZ(float aAngleInRadians)
SFVEC3F ntr
Near Top Right.
const SFVEC3F & GetCameraPos() const
void SetMaxZoom(float maxZoom)
glm::mat4 m_rotationMatrixAux
std::vector< float > m_scr_nY
std::vector< float > m_scr_nX
Precalc values array used to calc ray for each pixel (constant for the same window size).
const SFVEC2F & GetFocalLen() const
glm::mat4 m_projectionMatrixInv
SFVEC3F ftr
Far Top Right.
void SetProjection(PROJECTION_TYPE aProjection)
void RotateX_T1(float aAngleInRadians)