19 template <
int N,
typename Real>
35 inline operator bool()
const;
57 virtual void Evaluate(Real
t,
unsigned int maxOrder,
98 template <
int N,
typename Real>
114 template <
int N,
typename Real>
117 mTime(numSegments + 1),
124 std::copy(times, times + numSegments + 1,
mTime.begin());
129 template <
int N,
typename Real>
134 template <
int N,
typename Real>
inline 140 template <
int N,
typename Real>
inline 143 return mTime.front();
146 template <
int N,
typename Real>
inline 152 template <
int N,
typename Real>
inline 158 template <
int N,
typename Real>
inline 164 template <
int N,
typename Real>
167 if (
mTime.size() == 2)
174 template <
int N,
typename Real>
180 template <
int N,
typename Real>
186 template <
int N,
typename Real>
194 template <
int N,
typename Real>
203 template <
int N,
typename Real>
211 template <
int N,
typename Real>
214 std::function<Real(Real)> speed = [
this](Real
t)
223 Real accumulated = (Real)0;
235 auto iter0 = std::lower_bound(
mTime.begin(),
mTime.end(),
t0);
236 int index0 =
static_cast<int>(iter0 -
mTime.begin());
237 auto iter1 = std::lower_bound(
mTime.begin(),
mTime.end(),
t1);
238 int index1 =
static_cast<int>(iter1 -
mTime.begin());
247 mTime[index0], speed);
254 mTime[index1 - 1], t1, speed);
261 for (
int i = index0; i < isup; ++i)
273 template <
int N,
typename Real>
285 template <
int N,
typename Real>
288 if (length > (Real)0)
292 std::function<Real(Real)> F = [
this, &
length](Real
t)
303 Real omratio = (Real)1 - ratio;
304 Real tmid = omratio *
mTime.front() + ratio *
mTime.back();
311 else if (fmid < (Real)0)
325 return mTime.front();
329 template <
int N,
typename Real>
333 Real delta = (
mTime.back() -
mTime.front()) / (Real)(numPoints - 1);
334 for (
int i = 0; i < numPoints; ++i)
336 Real
t =
mTime.front() + delta * i;
341 template <
int N,
typename Real>
346 for (
int i = 0; i < numPoints; ++i)
void SubdivideByLength(int numPoints, Vector< N, Real > *points) const
Real GetTotalLength() const
GLfixed GLfixed GLint GLint order
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
unsigned int mMaxBisections
virtual void Evaluate(Real t, unsigned int maxOrder, Vector< N, Real > values[4]) const =0
std::vector< Real > mTime
Vector< N, Real > GetTangent(Real t) const
void SetTimeInterval(Real tmin, Real tmax)
GLenum GLsizei GLsizei GLint * values
Real GetLength(Real t0, Real t1) const
Vector< N, Real > GetPosition(Real t) const
std::vector< Real > mSegmentLength
void SubdivideByTime(int numPoints, Vector< N, Real > *points) const
GLfixed GLfixed GLint GLint GLfixed points
void SetRombergOrder(int order)
Real GetSpeed(Real t) const
std::vector< Real > mAccumulatedLength
void SetMaxBisections(unsigned int maxBisections)
Real Normalize(GVector< Real > &v, bool robust=false)
virtual ~ParametricCurve()
GLuint GLsizei GLsizei * length
GLdouble GLdouble GLdouble z
ParametricCurve(Real tmin, Real tmax)
Real GetTime(Real length) const
DualQuaternion< Real > Length(DualQuaternion< Real > const &d, bool robust=false)
GLsizei GLsizei numSegments
Real const * GetTimes() const
static Real Romberg(int order, Real a, Real b, std::function< Real(Real)> const &integrand)
int GetNumSegments() const
static unsigned int Find(std::function< Real(Real)> const &F, Real t0, Real t1, unsigned int maxIterations, Real &root)