-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHermiteSpline.h
62 lines (41 loc) · 1.3 KB
/
HermiteSpline.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
#pragma once
/*
This is a HermiteSpline system.
*/
#include "BaseSystem.h"
#include <shared/defs.h>
#include <util/util.h>
#include "animTcl.h"
#include <GLmodel/GLmodel.h>
#include "ControlPoint.h"
#include "LookUpTableEntry.h"
#include "shared/opengl.h"
#include <vector>
#define MAX_KNOTS 40
// HermiteSpline system
class HermiteSpline : public BaseSystem
{
public:
HermiteSpline(const std::string& name);
/*Setters needed for simulation*/
// returns the full length --> to know how long the max length is
float getFullLength();
// returns parameter U based on arclength S
float getU(LookUpTableEntry);
// returns a Control point at a certain parameter u of the spline
ControlPoint getPointAtU(float u);
// Nescessary functions
void display(GLenum mode = GL_RENDER);
int command(int argc, myCONST_SPEC char** argv);
float getArcLength(float t);
void load(std::string);
ControlPoint getNext(ControlPoint, ControlPoint, double);
void updateLookUpTable();
// Nescessary variables
std::vector <LookUpTableEntry> lookUpTable;
/* Define an array of ControlPoint structs with maximum of 40 control points*/
ControlPoint controlPoints[MAX_KNOTS];
//keeps track of the knots set by the user
int numKnots = 0;
protected:
};