Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CubicSpline Class Reference

#include <cubicsplines.h>

Public Member Functions

 CubicSpline ()
 
 ~CubicSpline ()
 
void createSpline (QVector P0, QVector P1, QVector P2, QVector P3)
 
QVector computePoint (double t) const
 

Detailed Description

Definition at line 22 of file cubicsplines.h.

Constructor & Destructor Documentation

CubicSpline::CubicSpline ( )

Source for CubicSpline class

Definition at line 6 of file cubicsplines.cpp.

7 {
8 #ifdef SPLINE_METHOD2
9  A = B = C = E = F = G = I = J = K = 0;
10  D = H = L = 1.0;
11 #else
12  memset( this, 0, sizeof (CubicSpline) );
13 #endif
14 }
CubicSpline::~CubicSpline ( )

Definition at line 40 of file cubicsplines.cpp.

41 {}

Member Function Documentation

QVector CubicSpline::computePoint ( double  t) const

Definition at line 34 of file cubicsplines.cpp.

References QVector.

Referenced by CubicSplinePrediction::InterpolatePosition().

35 {
36  QVector res( (A*t*t*t+B*t*t+C*t+D), (E*t*t*t+F*t*t+G*t+H), (I*t*t*t+J*t*t+K*t+L) );
37  return res;
38 }
void CubicSpline::createSpline ( QVector  P0,
QVector  P1,
QVector  P2,
QVector  P3 
)

Definition at line 16 of file cubicsplines.cpp.

Referenced by CubicSplinePrediction::InitInterpolation().

17 {
18  this->A = P3.i-3*P2.i+3*P1.i-P0.i;
19  this->B = 3*P2.i-6*P1.i+3*P0.i;
20  this->C = 3*P1.i-3*P0.i;
21  this->D = P0.i;
22 
23  this->E = P3.j-3*P2.j+3*P1.j-P0.j;
24  this->F = 3*P2.j-6*P1.j+3*P0.j;
25  this->G = 3*P1.j-3*P0.j;
26  this->H = P0.j;
27 
28  this->I = P3.k-3*P2.k+3*P1.k-P0.k;
29  this->J = 3*P2.k-6*P1.k+3*P0.k;
30  this->K = 3*P1.k-3*P0.k;
31  this->L = P0.k;
32 }

The documentation for this class was generated from the following files: