19 #include "precompiled.h"
95 #warning TODO: do something about CCinemaPath on GLES
98 glColor4f( RGBA.
X, RGBA.
Y, RGBA.
Z, RGBA.
W );
102 glEnable(GL_LINE_SMOOTH);
103 glBegin(GL_LINE_STRIP);
105 for (
int i=0; i<=smoothness; ++i)
110 glVertex3f( tmp.
X, tmp.
Y, tmp.
Z );
113 glDisable(GL_LINE_SMOOTH);
120 glEnable(GL_POINT_SMOOTH);
124 for (
int i=0; i<=smoothness; ++i)
129 glVertex3f( tmp.
X, tmp.
Y, tmp.
Z );
131 glColor3f(1.0f, 1.0f, 0.0f);
133 for (
size_t i=0; i<
Node.size(); ++i )
134 glVertex3f(
Node[i].Position.X,
Node[i].Position.Y,
Node[i].Position.Z);
138 glDisable(GL_POINT_SMOOTH);
153 start.
Slerp(start, end, nodet);
170 return 1.0f -
EaseIn(1.0f-t);
204 t = -(sqrt(1.0f - t*t) - 1.0f);
215 t = 1.0f - cos(t * (
float)
M_PI/2);
229 float previousTime = 0.0f, cumulation = 0.0f;
231 for (
size_t i = 0; i <
Node.size() - 1; ++i )
233 cumulation +=
Node[i].Distance;
242 previousTime +=
Node[i].Distance;
321 static const int smoothness = 200;
void Translate(float x, float y, float z)
float EaseOutIn(float t) const
float EaseCircle(float t) const
void FromEulerAngles(float x, float y, float z)
std::map< CStrW, CCinemaPath > m_Paths
bool Play(const float deltaRealTime)
Returns false if finished.
CVector3D GetPosition(float time) const
bool HasTrack(const CStrW &name) const
void QueuePath(const CStrW &name, bool queue)
float EaseGrowth(float t) const
float(CCinemaPath::* DistStylePtr)(float ratio) const
void SetCurrentPath(const CStrW &name, bool current, bool lines)
void SetAllPaths(const std::map< CStrW, CCinemaPath > &tracks)
void MoveToPointAt(float t, float nodet, const CVector3D &)
void Rotate(const CQuaternion &quat)
float EaseDefault(float t) const
float EaseSine(float t) const
std::list< CCinemaPath > m_PathQueue
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
CVector3D m_PreviousRotation
float GetNodeFraction() const
bool Update(const float deltaRealTime)
float EaseOut(float t) const
float EaseInOut(float t) const
void DrawSpline(const CVector4D &RGBA, int smoothness, bool lines) const
CGame * g_Game
Globally accessible pointer to the CGame object.
std::map< CStrW, CCinemaPath >::iterator m_CurrentPath
float(CCinemaPath::* DistModePtr)(float ratio) const
void UpdateFrustum(const CBoundingBoxAligned &scissor=CBoundingBoxAligned(CVector3D(-1.0f,-1.0f,-1.0f), CVector3D(1.0f, 1.0f, 1.0f)))
CGameView * GetView()
Get the pointer to the game view object.
void AddPath(CCinemaPath path, const CStrW &name)
float EaseIn(float t) const
void OverridePath(const CStrW &name)
void MoveToPointAt(float time)
float GetDuration() const
void Slerp(const CQuaternion &from, const CQuaternion &to, float ratio)
void debug_printf(const wchar_t *fmt,...)
write a formatted string to the debug channel, subject to filtering (see below).
float EaseExpo(float t) const