DDraceNetwork Docs
bezier.h
Go to the documentation of this file.
1#ifndef BASE_BEZIER_H
2#define BASE_BEZIER_H
3
4// Evaluates the Bernstein polynomial of degree 3/a one-dimensional Bezier curve
5//
6// https://en.wikipedia.org/w/index.php?title=Bernstein_polynomial&oldid=965314973
7//
8// f(t) = (1-t)³ a + 3(1-t)²t b + 3(1-t)t² c + t³ d
10{
11 float a;
12 float b;
13 float c;
14 float d;
15 CCubicBezier(float a_, float b_, float c_, float d_) :
16 a(a_), b(b_), c(c_), d(d_)
17 {
18 }
19
20public:
22 float Evaluate(float t) const;
23 float Derivative(float t) const;
24 static CCubicBezier With(float Start, float StartDerivative, float EndDerivative, float End);
25};
26
27#endif // BASE_BEZIER_H
Definition: bezier.h:10
float c
Definition: bezier.h:13
float b
Definition: bezier.h:12
float Derivative(float t) const
Definition: bezier.cpp:15
static CCubicBezier With(float Start, float StartDerivative, float EndDerivative, float End)
Definition: bezier.cpp:3
float a
Definition: bezier.h:11
CCubicBezier()
Definition: bezier.h:21
float Evaluate(float t) const
Definition: bezier.cpp:9
float d
Definition: bezier.h:14
CCubicBezier(float a_, float b_, float c_, float d_)
Definition: bezier.h:15