47 for(
int i=0; i<_nEyePoints; ++i)
49 m_eyePath.addPoint(_eyePoints[i]);
51 m_eyePath.createKnots();
53 for(
int i=0; i<_nLookPoints; ++i)
55 m_lookPath.addPoint(_lookPoints[i]);
57 m_lookPath.createKnots();
72 if (!FileIn.is_open())
74 std::cout <<
"File : "<<_fName<<
" Not found Exiting "<<std::endl;
77 unsigned int nEye,nLook;
78 FileIn >> nEye>>nLook;
80 std::unique_ptr<Vec4 []> eyePoints(
new Vec4[nEye]);
81 std::unique_ptr<Vec4 []> lookPoints(
new Vec4[nLook]);
83 for(
unsigned int i=0; i<nEye; ++i)
85 FileIn >> eyePoints[i];
87 for(
unsigned int i=0; i<nLook; ++i)
89 FileIn>> lookPoints[i];
95 for(
unsigned int i=0; i<nEye; ++i)
97 m_eyePath.addPoint(eyePoints[i].toVec3());
99 m_eyePath.createKnots();
101 for(
unsigned int i=0; i<nLook; ++i)
103 m_lookPath.addPoint(lookPoints[i].toVec3());
105 m_lookPath.createKnots();
117 m_lookCurvePoint=0.0;
119 std::ifstream FileIn;
122 if (!FileIn.is_open())
124 std::cout <<
"File : "<<_fName<<
" Not found Exiting "<<std::endl;
160 std::cout <<ept<<lpt<<std::endl;
~PathCamera() noexcept
dtor
Real m_step
the step for each update of the camera, the higher the number the smoother the movement ...
Generic Bezier Curve Class allowing the user to generate basic curves using a number of different con...
Vec4 & normalize() noexcept
Normalize the vector using .
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
Vec4 m_v
vector for the Camera local cord frame
void updateLooped() noexcept
update the camera by incrementing the step value and re-calculating the tx matrix if the camera is at...
Vec4 m_look
where the camera is looking to, used with Eye to calculate the Vector m_n
void setViewMatrix() noexcept
method to set the modelview matrix values for the current camera, this method load the matrix Modelvi...
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
implementation files for RibExport class
Real m_lookCurvePoint
the look path of the camera's current position value
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
Vec3 getPointOnCurve(Real _value) const noexcept
get a point on the curve in the range of 0 - 1 based on the control points
Real m_eyeCurvePoint
the eye path of the camera's current position value
BezierCurve m_eyePath
BezierCurve for the the eye positions.
void set(Real _x, Real _y, Real _z, Real _w=1.0) noexcept
sets the vector component from 3 values
Vec4 m_eye
the position of the Camera used to calculate the local cord frame
Vec4 m_up
gives a general indication of which way up the camera is
Vec4 m_n
vector for the Camera local cord frame
stream helpers for ngl data types
DIRECTION m_dir
current direction of the camera
void drawPaths() const noexcept
a method to draw the camera paths for debugging etc (note uses immediate mode GL) ...
Vec4 m_u
vector for the Camera local cord frame
void loadPath(const std::string &_fName) noexcept
load a path from a file
a simple camera attached to a path inherits from Camera
BezierCurve m_lookPath
BezierCurve for the look positions.
void createCurvesForDrawing(int _lod) noexcept
create the display lists for the paths so we can see them
void setLOD(int _lod) noexcept
set the Level of Detail for Drawing
void update() noexcept
update the camera by incrementing the step value and re-calculating the tx matrix ...
GLsizei const GLchar *const * string
void cross(const Vec4 &_v1, const Vec4 &_v2) noexcept
set the vector as the cross product from 2 other vectors