Fission FSN
Loading...
Searching...
No Matches
fsCBezierPath.h
Go to the documentation of this file.
1/********************************************************************
2*
3* Created: 2/5/2013 8:40
4*
5* File: fsCBezierPath.h
6*
7* Author: Martin P. King
8*
9* Purpose: Stitched together Bezier curves to form a more
10* complex path
11*
12*********************************************************************/
13
14#ifndef fsCBezierPathhdr
15#define fsCBezierPathhdr
16
17#include <vector>
18#include "../fsBaseTypes.h"
19#include "../fsVec2d.h"
20
21
23{
24public:
25
26 fsVec2d startPosGet() const;
27
28 fsVec2d update(fsS32 pElapsedMs);
29
30 fsCBezierPath(const std::vector<fsVec2d>& pKnots, fsS32 pDuration);
32
33protected:
34
35private:
36
37 void knotLengthsCalculate();
38
39 static fsF32 distanceBetweenKnots(const fsVec2d& pKnotA, const fsVec2d& pKnotB);
40
41 static std::vector<fsF32> firstControlPointsGet(std::vector<fsF32> pRHS);
42
43 static void curveControlPointsGet(
44 std::vector<fsVec2d> pKnots,
45 std::vector<fsVec2d>& pFirstControlPoints,
46 std::vector<fsVec2d>& pSecondControlPoints);
47
48 static fsVec2d pointOnBezierGet(fsF32 pTime,
49 const fsVec2d& pP1,
50 const fsVec2d& pP1Control,
51 const fsVec2d& pP2Control,
52 const fsVec2d& pP2);
53
54 std::vector<fsVec2d> mKnots;
55 std::vector<fsVec2d> mFirstControlPoints;
56 std::vector<fsVec2d> mSecondControlPoints;
57
58 fsS32 mCurrentKnot;
59
60 fsF32 mKnotLenghtTotal;
61 std::vector<fsF32> mKnotLenghts;
62
63 fsS32 mDuration;
64};
65
66#endif
fsVec2d startPosGet() const
Definition fsCBezierPath.cpp:6
fsCBezierPath(const std::vector< fsVec2d > &pKnots, fsS32 pDuration)
Definition fsCBezierPath.cpp:189
fsVec2d update(fsS32 pElapsedMs)
Definition fsCBezierPath.cpp:18
int fsS32
Definition fsBaseTypes.h:20
float fsF32
Definition fsBaseTypes.h:28
Definition fsVec2d.h:16