2015-12-08 07:31:57 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-07-19 17:35:25 +00:00
|
|
|
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
2024-03-03 18:11:42 +00:00
|
|
|
* Copyright (C) 2015-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
2015-12-08 07:31:57 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2021-01-03 22:23:00 +00:00
|
|
|
* @file camera.h
|
|
|
|
* @brief Define an abstract camera.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
#ifndef CAMERA_H
|
|
|
|
#define CAMERA_H
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2023-09-26 11:40:17 +00:00
|
|
|
#include <gal/gal.h>
|
2023-09-23 19:53:14 +00:00
|
|
|
#include <plugins/3dapi/xv3d_types.h>
|
2016-07-19 17:35:25 +00:00
|
|
|
#include <wx/gdicmn.h> // for wxSize
|
2015-12-08 07:31:57 +00:00
|
|
|
#include <vector>
|
2024-03-03 18:11:42 +00:00
|
|
|
#include <3d_enums.h>
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2019-12-30 13:01:06 +00:00
|
|
|
enum class PROJECTION_TYPE
|
2015-12-08 07:31:57 +00:00
|
|
|
{
|
2021-06-17 11:21:06 +00:00
|
|
|
ORTHO = 0,
|
2019-12-30 13:01:06 +00:00
|
|
|
PERSPECTIVE
|
2015-12-08 07:31:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Frustum is a implementation based on a tutorial by
|
|
|
|
* http://www.lighthouse3d.com/tutorials/view-frustum-culling/
|
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
struct CAMERA_FRUSTUM
|
2015-12-08 07:31:57 +00:00
|
|
|
{
|
|
|
|
SFVEC3F nc;
|
|
|
|
SFVEC3F fc;
|
|
|
|
SFVEC3F ntl; ///< Near Top Left
|
|
|
|
SFVEC3F ntr; ///< Near Top Right
|
|
|
|
SFVEC3F nbl; ///< Near Bottom Left
|
|
|
|
SFVEC3F nbr; ///< Near Bottom Right
|
|
|
|
SFVEC3F ftl; ///< Far Top Left
|
|
|
|
SFVEC3F ftr; ///< Far Top Right
|
|
|
|
SFVEC3F fbl; ///< Far Bottom Left
|
|
|
|
SFVEC3F fbr; ///< Far Bottom Right
|
|
|
|
float nearD, farD, ratio, angle, tang;
|
|
|
|
float nw, nh, fw, fh;
|
2023-10-27 20:48:03 +00:00
|
|
|
|
|
|
|
CAMERA_FRUSTUM() :
|
|
|
|
nc( { 0.0, 0.0, 0.0 } ),
|
|
|
|
fc( { 0.0, 0.0, 0.0 } ),
|
|
|
|
ntl( { 0.0, 0.0, 0.0 } ),
|
|
|
|
ntr( { 0.0, 0.0, 0.0 } ),
|
|
|
|
nbl( { 0.0, 0.0, 0.0 } ),
|
|
|
|
nbr( { 0.0, 0.0, 0.0 } ),
|
|
|
|
ftl( { 0.0, 0.0, 0.0 } ),
|
|
|
|
ftr( { 0.0, 0.0, 0.0 } ),
|
|
|
|
fbl( { 0.0, 0.0, 0.0 } ),
|
|
|
|
fbr( { 0.0, 0.0, 0.0 } ),
|
|
|
|
nearD( 0.0 ),
|
|
|
|
farD( 0.0 ),
|
|
|
|
ratio( 1.0 ),
|
|
|
|
angle( 0.0 ),
|
|
|
|
tang( 0.0 ),
|
|
|
|
nw( 0.0 ),
|
|
|
|
nh( 0.0 ),
|
|
|
|
fw( 0.0 ),
|
|
|
|
fh( 0.0 )
|
|
|
|
{
|
|
|
|
}
|
2015-12-08 07:31:57 +00:00
|
|
|
};
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-12-30 13:01:06 +00:00
|
|
|
enum class CAMERA_INTERPOLATION
|
2016-07-19 17:35:25 +00:00
|
|
|
{
|
2019-12-30 13:01:06 +00:00
|
|
|
LINEAR,
|
|
|
|
EASING_IN_OUT, // Quadratic
|
|
|
|
BEZIER,
|
2016-07-19 17:35:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* A class used to derive camera objects from.
|
2015-12-08 07:31:57 +00:00
|
|
|
*
|
2020-12-13 23:02:57 +00:00
|
|
|
* It must be derived by other classes to implement a real camera object.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
2023-09-26 11:40:17 +00:00
|
|
|
class GAL_API CAMERA
|
2015-12-08 07:31:57 +00:00
|
|
|
{
|
2020-12-13 23:02:57 +00:00
|
|
|
public:
|
2023-01-10 22:30:05 +00:00
|
|
|
static const float DEFAULT_MIN_ZOOM;
|
|
|
|
static const float DEFAULT_MAX_ZOOM;
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Initialize a camera.
|
|
|
|
*
|
2021-09-15 22:01:24 +00:00
|
|
|
* @param aInitialDistance Initial Z-distance to the board
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
2021-09-15 22:01:24 +00:00
|
|
|
explicit CAMERA( float aInitialDistance );
|
2024-03-03 18:11:42 +00:00
|
|
|
explicit CAMERA( SFVEC3F aInitPos, SFVEC3F aLookat, PROJECTION_TYPE aProjectionType );
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
virtual ~CAMERA()
|
2020-02-05 22:19:14 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Get the rotation matrix to be applied in a transformation camera.
|
|
|
|
*
|
2015-12-08 07:31:57 +00:00
|
|
|
* @return the rotation matrix of the camera
|
|
|
|
*/
|
2021-06-24 08:47:28 +00:00
|
|
|
glm::mat4 GetRotationMatrix() const;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
const glm::mat4& GetViewMatrix() const;
|
|
|
|
const glm::mat4& GetViewMatrix_Inv() const;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
const glm::mat4& GetProjectionMatrix() const;
|
|
|
|
const glm::mat4& GetProjectionMatrixInv() const;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
const SFVEC3F& GetRight() const { return m_right; }
|
|
|
|
const SFVEC3F& GetUp() const { return m_up; }
|
|
|
|
const SFVEC3F& GetDir() const { return m_dir; }
|
|
|
|
const SFVEC3F& GetPos() const { return m_pos; }
|
|
|
|
const SFVEC2F& GetFocalLen() const { return m_focalLen; }
|
2015-12-08 07:31:57 +00:00
|
|
|
float GetNear() const { return m_frustum.nearD; }
|
|
|
|
float GetFar() const { return m_frustum.farD; }
|
2021-06-24 08:47:28 +00:00
|
|
|
const CAMERA_FRUSTUM& GetFrustum() const { return m_frustum; }
|
|
|
|
const SFVEC3F& GetLookAtPos() const { return m_lookat_pos; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the rotation matrix to be applied in a transformation camera, without
|
|
|
|
* making any new calculations on camera.
|
|
|
|
*
|
|
|
|
* @param aRotation is the total rotation matrix of the camera.
|
|
|
|
*/
|
|
|
|
void SetRotationMatrix( const glm::mat4& aRotation );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the affine matrix to be applied to a transformation camera.
|
|
|
|
*
|
|
|
|
* @param aViewMatrix is the affine matrix of the camera. The affine matrix
|
|
|
|
* maps coordinates in the world frame to those in the
|
|
|
|
* camera frame.
|
|
|
|
*/
|
|
|
|
void SetViewMatrix( glm::mat4 aViewMatrix );
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-06-11 13:10:36 +00:00
|
|
|
void SetBoardLookAtPos( const SFVEC3F& aBoardPos );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
void SetLookAtPos_T1( const SFVEC3F& aLookAtPos )
|
2020-12-13 23:02:57 +00:00
|
|
|
{
|
2016-07-19 17:35:25 +00:00
|
|
|
m_lookat_pos_t1 = aLookAtPos;
|
|
|
|
}
|
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
const SFVEC3F& GetLookAtPos_T1() const { return m_lookat_pos_t1; }
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
const SFVEC3F& GetCameraPos() const { return m_camera_pos; }
|
2021-10-24 17:30:40 +00:00
|
|
|
const SFVEC3F& GetCameraInitPos() const { return m_camera_pos_init; }
|
|
|
|
|
|
|
|
float GetCameraMinDimension() const;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculate a new mouse drag position
|
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
virtual void Drag( const wxPoint& aNewMousePosition ) = 0;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
virtual void Pan( const wxPoint& aNewMousePosition ) = 0;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
virtual void Pan( const SFVEC3F& aDeltaOffsetInc ) = 0;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
virtual void Pan_T1( const SFVEC3F& aDeltaOffsetInc ) = 0;
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
|
|
|
* Reset the camera to initial state
|
|
|
|
*/
|
2016-07-19 17:35:25 +00:00
|
|
|
virtual void Reset();
|
|
|
|
virtual void Reset_T1();
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
void ResetXYpos();
|
|
|
|
void ResetXYpos_T1();
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-07-05 08:04:36 +00:00
|
|
|
/**
|
|
|
|
* Get the current mouse position.
|
|
|
|
*/
|
2021-06-24 08:47:28 +00:00
|
|
|
const wxPoint& GetCurMousePosition() { return m_lastPosition; }
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Update the current mouse position without make any new calculations on camera.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
void SetCurMousePosition( const wxPoint& aPosition );
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
void ToggleProjection();
|
2020-03-18 22:48:36 +00:00
|
|
|
PROJECTION_TYPE GetProjection() { return m_projectionType; }
|
2021-06-17 11:21:06 +00:00
|
|
|
void SetProjection( PROJECTION_TYPE aProjection ) { m_projectionType = aProjection; }
|
2016-07-19 17:35:25 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Update the windows size of the camera.
|
|
|
|
*
|
|
|
|
* @return true if the windows size changed since last time.
|
2016-07-19 17:35:25 +00:00
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
bool SetCurWindowSize( const wxSize& aSize );
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
void ZoomReset();
|
|
|
|
|
2017-01-14 14:17:56 +00:00
|
|
|
bool Zoom( float aFactor );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2017-01-14 14:17:56 +00:00
|
|
|
bool Zoom_T1( float aFactor );
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-10-24 17:30:40 +00:00
|
|
|
float GetZoom() const { return m_zoom; }
|
|
|
|
|
|
|
|
float GetMinZoom() { return m_minZoom; }
|
|
|
|
void SetMinZoom( float minZoom )
|
|
|
|
{
|
|
|
|
m_minZoom = minZoom;
|
|
|
|
zoomChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
float GetMaxZoom() { return m_maxZoom; }
|
|
|
|
void SetMaxZoom( float maxZoom )
|
|
|
|
{
|
|
|
|
m_maxZoom = maxZoom;
|
|
|
|
zoomChanged();
|
|
|
|
}
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2024-03-03 18:11:42 +00:00
|
|
|
bool ViewCommand_T1( VIEW3D_TYPE aRequestedView );
|
|
|
|
|
2024-06-08 18:13:01 +00:00
|
|
|
/**
|
|
|
|
* Rotates the camera in screen plane.
|
|
|
|
*/
|
|
|
|
void RotateScreen( float aAngleInRadians );
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
void RotateX( float aAngleInRadians );
|
|
|
|
void RotateY( float aAngleInRadians );
|
|
|
|
void RotateZ( float aAngleInRadians );
|
|
|
|
|
|
|
|
void RotateX_T1( float aAngleInRadians );
|
|
|
|
void RotateY_T1( float aAngleInRadians );
|
|
|
|
void RotateZ_T1( float aAngleInRadians );
|
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* This will set T0 and T1 with the current values.
|
2016-07-19 17:35:25 +00:00
|
|
|
*/
|
|
|
|
virtual void SetT0_and_T1_current_T();
|
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* It will update the matrix to interpolate between T0 and T1 values.
|
|
|
|
*
|
|
|
|
* @param t the interpolation time, between 0.0f and 1.0f (it will clamp if >1).
|
2016-07-19 17:35:25 +00:00
|
|
|
*/
|
|
|
|
virtual void Interpolate( float t );
|
|
|
|
|
|
|
|
void SetInterpolateMode( CAMERA_INTERPOLATION aInterpolateMode )
|
|
|
|
{
|
|
|
|
m_interpolation_mode = aInterpolateMode;
|
|
|
|
}
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* @return true if some of the parameters in camera was changed, it will reset the flag.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
bool ParametersChanged();
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* @return true if some of the parameters in camera was changed, it will NOT reset the flag.
|
2016-07-19 17:35:25 +00:00
|
|
|
*/
|
|
|
|
bool ParametersChangedQuery() const { return m_parametersChanged; }
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Make a ray based on a windows screen position.
|
|
|
|
*
|
|
|
|
* @param aWindowPos the windows buffer position.
|
|
|
|
* @param aOutOrigin out origin position of the ray.
|
|
|
|
* @param aOutDirection out direction
|
2016-07-19 17:35:25 +00:00
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
void MakeRay( const SFVEC2I& aWindowPos, SFVEC3F& aOutOrigin, SFVEC3F& aOutDirection ) const;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2016-10-22 22:37:13 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Make a ray based on a windows screen position, it will interpolate based on the
|
|
|
|
* \a aWindowPos.
|
|
|
|
*
|
|
|
|
* @param aWindowPos the windows buffer position (float value).
|
|
|
|
* @param aOutOrigin out origin position of the ray.
|
|
|
|
* @param aOutDirection out direction.
|
2016-10-22 22:37:13 +00:00
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
void MakeRay( const SFVEC2F& aWindowPos, SFVEC3F& aOutOrigin, SFVEC3F& aOutDirection ) const;
|
2016-10-22 22:37:13 +00:00
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Make a ray based on the latest mouse position.
|
|
|
|
*
|
|
|
|
* @param aOutOrigin out origin position of the ray.
|
|
|
|
* @param aOutDirection out direction.
|
2016-07-19 17:35:25 +00:00
|
|
|
*/
|
2021-06-11 10:57:15 +00:00
|
|
|
void MakeRayAtCurrentMousePosition( SFVEC3F& aOutOrigin, SFVEC3F& aOutDirection ) const;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-07-05 08:04:36 +00:00
|
|
|
/**
|
|
|
|
* Update the camera.
|
|
|
|
*/
|
2021-06-24 08:47:28 +00:00
|
|
|
void Update() { updateFrustum(); }
|
|
|
|
|
2020-12-13 23:02:57 +00:00
|
|
|
protected:
|
2021-10-24 17:30:40 +00:00
|
|
|
void zoomChanged();
|
2015-12-08 07:31:57 +00:00
|
|
|
void rebuildProjection();
|
|
|
|
void updateFrustum();
|
|
|
|
void updateViewMatrix();
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
void updateRotationMatrix();
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2021-09-15 22:01:24 +00:00
|
|
|
* 3D zoom value -- Z-distance is scaled by it
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
float m_zoom;
|
2016-07-19 17:35:25 +00:00
|
|
|
float m_zoom_t0;
|
|
|
|
float m_zoom_t1;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2021-10-24 17:30:40 +00:00
|
|
|
/**
|
|
|
|
* Possible 3D zoom range
|
|
|
|
*/
|
|
|
|
float m_minZoom;
|
|
|
|
float m_maxZoom;
|
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* The window size that this camera is working.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
2016-07-19 17:35:25 +00:00
|
|
|
SFVEC2I m_windowSize;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* The last mouse position in the screen
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
wxPoint m_lastPosition;
|
|
|
|
|
|
|
|
glm::mat4 m_rotationMatrix;
|
2016-07-19 17:35:25 +00:00
|
|
|
glm::mat4 m_rotationMatrixAux;
|
2015-12-08 07:31:57 +00:00
|
|
|
glm::mat4 m_viewMatrix;
|
2016-07-19 17:35:25 +00:00
|
|
|
glm::mat4 m_viewMatrixInverse;
|
2015-12-08 07:31:57 +00:00
|
|
|
glm::mat4 m_projectionMatrix;
|
2016-07-19 17:35:25 +00:00
|
|
|
glm::mat4 m_projectionMatrixInv;
|
2015-12-08 07:31:57 +00:00
|
|
|
PROJECTION_TYPE m_projectionType;
|
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
CAMERA_FRUSTUM m_frustum;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
SFVEC3F m_right;
|
|
|
|
SFVEC3F m_up;
|
|
|
|
SFVEC3F m_dir;
|
|
|
|
SFVEC3F m_pos;
|
|
|
|
|
|
|
|
SFVEC2F m_focalLen;
|
|
|
|
|
|
|
|
SFVEC3F m_camera_pos_init;
|
|
|
|
SFVEC3F m_camera_pos;
|
2016-07-19 17:35:25 +00:00
|
|
|
SFVEC3F m_camera_pos_t0;
|
|
|
|
SFVEC3F m_camera_pos_t1;
|
|
|
|
|
|
|
|
SFVEC3F m_lookat_pos;
|
|
|
|
SFVEC3F m_lookat_pos_t0;
|
|
|
|
SFVEC3F m_lookat_pos_t1;
|
2020-12-13 23:02:57 +00:00
|
|
|
SFVEC3F m_board_lookat_pos_init; ///< Default boardlookat position (the board center).
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2020-12-13 23:02:57 +00:00
|
|
|
SFVEC3F m_rotate_aux; ///< Stores the rotation angle auxiliary.
|
2016-07-19 17:35:25 +00:00
|
|
|
SFVEC3F m_rotate_aux_t0;
|
|
|
|
SFVEC3F m_rotate_aux_t1;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
CAMERA_INTERPOLATION m_interpolation_mode;
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Precalc values array used to calc ray for each pixel (constant for the same window size).
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
std::vector< float > m_scr_nX;
|
|
|
|
std::vector< float > m_scr_nY;
|
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Precalc values array used to calc ray for each pixel, for X and Y axis of each new
|
|
|
|
* camera position.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
std::vector< SFVEC3F > m_right_nX;
|
|
|
|
std::vector< SFVEC3F > m_up_nY;
|
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Set to true if any of the parameters in the camera was changed
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
|
|
|
bool m_parametersChanged;
|
|
|
|
|
|
|
|
/**
|
2020-12-13 23:02:57 +00:00
|
|
|
* Trace mask used to enable or disable the trace output of this class.
|
|
|
|
*
|
|
|
|
* The debug output can be turned on by setting the WXTRACE environment variable to
|
2021-01-02 21:05:29 +00:00
|
|
|
* "KI_TRACE_CAMERA". See the wxWidgets documentation on wxLogTrace for
|
2020-12-13 23:02:57 +00:00
|
|
|
* more information.
|
2015-12-08 07:31:57 +00:00
|
|
|
*/
|
2021-01-02 21:05:29 +00:00
|
|
|
static const wxChar* m_logTrace;
|
2015-12-08 07:31:57 +00:00
|
|
|
};
|
|
|
|
|
2021-01-02 21:05:29 +00:00
|
|
|
#endif // CAMERA_H
|