33#include "../3d_rendering/raytracing/ray.h"
88 explicit CAMERA(
float aInitialDistance );
151 virtual void Drag(
const wxPoint& aNewMousePosition ) = 0;
153 virtual void Pan(
const wxPoint& aNewMousePosition ) = 0;
162 virtual void Reset();
191 bool Zoom(
float aFactor );
211 void RotateX(
float aAngleInRadians );
212 void RotateY(
float aAngleInRadians );
213 void RotateZ(
float aAngleInRadians );
Generic cubic Bezier representation.
A class used to derive camera objects from.
glm::mat4 GetRotationMatrix() const
Get the rotation matrix to be applied in a transformation camera.
const SFVEC3F & GetRight() const
bool m_parametersChanged
Set to true if any of the parameters in the camera was changed.
void RotateY(float aAngleInRadians)
glm::mat4 m_projectionMatrixInv
void RotateX(float aAngleInRadians)
const CAMERA_FRUSTUM & GetFrustum() const
const glm::mat4 & GetProjectionMatrix() const
bool ParametersChangedQuery() const
void SetMinZoom(float minZoom)
void SetBoardLookAtPos(const SFVEC3F &aBoardPos)
void SetProjection(PROJECTION_TYPE aProjection)
const SFVEC3F & GetPos() const
void RotateY_T1(float aAngleInRadians)
virtual void Pan(const wxPoint &aNewMousePosition)=0
virtual void Reset()
Reset the camera to initial state.
glm::mat4 m_projectionMatrix
CAMERA_INTERPOLATION m_interpolation_mode
wxPoint m_lastPosition
The last mouse position in the screen.
const glm::mat4 & GetViewMatrix_Inv() const
PROJECTION_TYPE GetProjection()
bool Zoom_T1(float aFactor)
static const float DEFAULT_MIN_ZOOM
void updateRotationMatrix()
void MakeRay(const SFVEC2I &aWindowPos, SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on a windows screen position.
static const float DEFAULT_MAX_ZOOM
virtual void Pan_T1(const SFVEC3F &aDeltaOffsetInc)=0
virtual void Interpolate(float t)
It will update the matrix to interpolate between T0 and T1 values.
const SFVEC3F & GetUp() const
virtual void Drag(const wxPoint &aNewMousePosition)=0
Calculate a new mouse drag position.
bool SetCurWindowSize(const wxSize &aSize)
Update the windows size of the camera.
void SetInterpolateMode(CAMERA_INTERPOLATION aInterpolateMode)
SFVEC3F m_camera_pos_init
CAMERA(float aInitialDistance)
Initialize a camera.
const glm::mat4 & GetProjectionMatrixInv() const
float m_minZoom
Possible 3D zoom range.
float GetCameraMinDimension() const
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.
void RotateZ(float aAngleInRadians)
const SFVEC2F & GetFocalLen() const
virtual void SetT0_and_T1_current_T()
This will set T0 and T1 with the current values.
PROJECTION_TYPE m_projectionType
SFVEC2I m_windowSize
The window size that this camera is working.
void MakeRayAtCurrentMousePosition(SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on the latest mouse position.
std::vector< float > m_scr_nX
Precalc values array used to calc ray for each pixel (constant for the same window size).
void RotateX_T1(float aAngleInRadians)
const glm::mat4 & GetViewMatrix() const
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 SetViewMatrix(glm::mat4 aViewMatrix)
Set the affine matrix to be applied to a transformation camera.
void RotateZ_T1(float aAngleInRadians)
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
void SetRotationMatrix(const glm::mat4 &aRotation)
Set the rotation matrix to be applied in a transformation camera, without making any new calculations...
float m_zoom
3D zoom value – Z-distance is scaled by it
void Update()
Update the camera.
void SetCurMousePosition(const wxPoint &aPosition)
Update the current mouse position without make any new calculations on 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.