32 lines
585 B
C
32 lines
585 B
C
|
#ifndef __CATMULLROMSPLINE_H
|
||
|
#define __CATMULLROMSPLINE_H
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <SDL.h>
|
||
|
#include <SDL_opengl.h>
|
||
|
#include "matrix.h"
|
||
|
#include "punkt2d.h"
|
||
|
#include "punkt3d.h"
|
||
|
|
||
|
|
||
|
class CatmullRomSpline {
|
||
|
private:
|
||
|
Matrix *cr;
|
||
|
float s;
|
||
|
|
||
|
void makeMatrix();
|
||
|
public:
|
||
|
CatmullRomSpline(float _s=0.5f);
|
||
|
|
||
|
Matrix getPosition(float u, Matrix &controlpoints);
|
||
|
Punkt3D getPosition(float u, Punkt3D a, Punkt3D b, Punkt3D c, Punkt3D d);
|
||
|
Punkt2D getPosition(float u, Punkt2D a, Punkt2D b, Punkt2D c, Punkt2D d);
|
||
|
|
||
|
|
||
|
void setS(float _s);
|
||
|
~CatmullRomSpline();
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif
|