NGL  6.5
The NCCA Graphics Library
PathCamera.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 Jon Macey
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef PATHCAMERA_H_
18 #define PATHCAMERA_H_
19 //----------------------------------------------------------------------------------------------------------------------
22 //----------------------------------------------------------------------------------------------------------------------
23 #include "BezierCurve.h"
24 #include "Camera.h"
25 
26 namespace ngl
27 {
28 //----------------------------------------------------------------------------------------------------------------------
32 //----------------------------------------------------------------------------------------------------------------------
34 {
35 
36 public :
37 
39  //----------------------------------------------------------------------------------------------------------------------
46  //----------------------------------------------------------------------------------------------------------------------
47  PathCamera( const Vec3 &_up, const BezierCurve &_eyePath, const BezierCurve &_lookPath, const Real _step ) noexcept;
48  //----------------------------------------------------------------------------------------------------------------------
57  //----------------------------------------------------------------------------------------------------------------------
58  PathCamera( const Vec3 &_up,Vec3 const *_eyePoints, int _nEyePoints,Vec3 const *_lookPoints, int _nLookPoints,Real _step) noexcept;
59 
60  //----------------------------------------------------------------------------------------------------------------------
66  //----------------------------------------------------------------------------------------------------------------------
67  PathCamera( const Vec4 &_up, const std::string &_fName, Real _step ) noexcept;
68 
69  //----------------------------------------------------------------------------------------------------------------------
71  //----------------------------------------------------------------------------------------------------------------------
72  ~PathCamera() noexcept;
73  //----------------------------------------------------------------------------------------------------------------------
75  //----------------------------------------------------------------------------------------------------------------------
76  void update() noexcept;
77  //----------------------------------------------------------------------------------------------------------------------
80  //----------------------------------------------------------------------------------------------------------------------
81  void updateLooped() noexcept;
82  //----------------------------------------------------------------------------------------------------------------------
84  //----------------------------------------------------------------------------------------------------------------------
85  void drawPaths() const noexcept;
86  //----------------------------------------------------------------------------------------------------------------------
89  //----------------------------------------------------------------------------------------------------------------------
90  void loadPath( const std::string &_fName) noexcept;
91  //----------------------------------------------------------------------------------------------------------------------
94  //----------------------------------------------------------------------------------------------------------------------
95  void createCurvesForDrawing( int _lod ) noexcept;
96 
97 protected:
98  //----------------------------------------------------------------------------------------------------------------------
100  //----------------------------------------------------------------------------------------------------------------------
102  //----------------------------------------------------------------------------------------------------------------------
104  //----------------------------------------------------------------------------------------------------------------------
106  //----------------------------------------------------------------------------------------------------------------------
108  //----------------------------------------------------------------------------------------------------------------------
111  //----------------------------------------------------------------------------------------------------------------------
113  //----------------------------------------------------------------------------------------------------------------------
115  //----------------------------------------------------------------------------------------------------------------------
117  {
121  CAMBWD
122  };
123  //----------------------------------------------------------------------------------------------------------------------
125  //----------------------------------------------------------------------------------------------------------------------
127  //----------------------------------------------------------------------------------------------------------------------
129  //----------------------------------------------------------------------------------------------------------------------
131 
132 
133 };
134 }
135 #endif
136 //----------------------------------------------------------------------------------------------------------------------
137 
138 
Real m_step
the step for each update of the camera, the higher the number the smoother the movement ...
Definition: PathCamera.h:130
Generic Bezier Curve Class allowing the user to generate basic curves using a number of different con...
Definition: BezierCurve.h:45
camera going forward
Definition: PathCamera.h:119
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
Definition: Vec4.h:57
#define NGL_DLLEXPORT
Definition: Types.h:65
Inherits from Camera and adds a path for both eye and look using two Bezier Curves.
Definition: PathCamera.h:33
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
Definition: Vec3.h:51
implementation files for RibExport class
Definition: AABB.cpp:22
Real m_lookCurvePoint
the look path of the camera&#39;s current position value
Definition: PathCamera.h:105
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
Definition: Types.h:127
Real m_eyeCurvePoint
the eye path of the camera&#39;s current position value
Definition: PathCamera.h:101
BezierCurve m_eyePath
BezierCurve for the the eye positions.
Definition: PathCamera.h:109
simple camera class to allow movement in an opengl scene. a lot of this stuff is from the HILL book C...
Definition: Camera.h:54
DIRECTION m_dir
current direction of the camera
Definition: PathCamera.h:126
BezierCurve m_lookPath
BezierCurve for the look positions.
Definition: PathCamera.h:112
a simple camera class based on the Hill Book
DIRECTION
enumeration for the camera&#39;s direction
Definition: PathCamera.h:116
basic BezierCurve using CoxDeBoor algorithm
GLsizei const GLchar *const * string
Definition: glew.h:1847