-
Notifications
You must be signed in to change notification settings - Fork 0
/
spline.h
67 lines (46 loc) · 1.26 KB
/
spline.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __SPLINE_H__
#define __SPLINE_H__
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
using namespace Eigen;
using namespace std;
class Spline
{
public:
Spline(void);
Spline(vector<Vector3f>& vlist);
Vector3f getSpline(float t, string spline_t="CATMULL_ROM", bool closed=false);
~Spline(void);
private:
Vector3f _catmullRom(float t, bool closed);
Vector3f _bspline(float t);
vector<Vector3f> _vector_list;
};
class QuaternionSpline : public Spline
{
public:
QuaternionSpline(vector<Quaternionf>& vlist);
Quaternionf getSpline(float t, string spline_t="CATMULL_ROM", bool closed=false);
private:
Quaternionf _catmullRom(float t, bool closed=false);
//Vector3f _bspline(float t);
Quaternionf safe_slerp(float t, Quaternionf& from, Quaternionf& to);
vector<Quaternionf> _quat_list;
};
class FloatSpline : public Spline
{
public:
FloatSpline(vector<float>& vlist);
float getSpline(float t, string spline_t="CATMULL_ROM", bool closed=false);
private:
float _catmullRom(float t, bool closed=false);
//Vector3f _bspline(float t);
vector<float> _val_list;
};
#endif