aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-11-01 23:32:22 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-11-01 23:32:22 +0800
commitf68cc9034a576b6f91cf0db0344ece971944c973 (patch)
tree123744e85445f51d058b74d9c9fb2174f6abefd7 /include
parent1981e9bc81e92f479c725e6ac60ff3bd419cefd0 (diff)
downloadbullet-lab-remix-f68cc9034a576b6f91cf0db0344ece971944c973.tar.xz
Move hge to an archive.
Finish the main part of smPath. This is a C++ project, add C++ tags to all source code that could be identified as C source files.
Diffstat (limited to 'include')
-rw-r--r--include/smpath.hpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/include/smpath.hpp b/include/smpath.hpp
index 48bb930..98eec6f 100644
--- a/include/smpath.hpp
+++ b/include/smpath.hpp
@@ -14,9 +14,15 @@
class smPathBase
{
public:
- virtual smvec2d getPointOnPath(double percentage);
- virtual double getPathLength();
- virtual ~smPathBase(){};
+ virtual smvec2d getPointOnPath(double rt){return smvec2d(0,0);}
+ virtual double getPathLength()//default lowres length calculator
+ {
+ double ret=0;
+ for(int i=0;i<63;++i)
+ ret+=(getPointOnPath(i/64.)-getPointOnPath((i+1)/64.)).l();
+ return ret;
+ }
+ virtual ~smPathBase(){}
};
class smPathSegment:public smPathBase
{
@@ -24,8 +30,8 @@ private:
smvec2d a,b;
public:
smPathSegment(smvec2d _a,smvec2d _b);
- smvec2d getPointOnPath(double percentage);
- double getPathLength();
+ smvec2d getPointOnPath(double rt)override;
+ double getPathLength()override;
};
class smPathCircular:public smPathBase
{
@@ -34,13 +40,17 @@ private:
double a,b,r;
public:
smPathCircular(smvec2d _ctr,double _a,double _b,double _r);
- smvec2d getPointOnPath(double percentage);
- double getPathLength();
+ smvec2d getPointOnPath(double rt)override;
+ double getPathLength()override;
};
class smPathCollection
{
private:
smPathBase* paths[16];
+ int cpaths;
public:
+ int pushPath(smPathBase *p);
+ smPathBase* getPath(int pid);
+ smvec2d getPointOnCollection(double rt);
};
#endif