From 9b5621bda033c2e6b7c622c7494c56a172543554 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 12 Oct 2015 22:55:41 +0800 Subject: Initial implementation of smPath. Minor changes on the (s)coll effect. --- extensions/smpath.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 extensions/smpath.cpp (limited to 'extensions/smpath.cpp') diff --git a/extensions/smpath.cpp b/extensions/smpath.cpp new file mode 100644 index 0000000..d86e18b --- /dev/null +++ b/extensions/smpath.cpp @@ -0,0 +1,13 @@ +#include +#include "smpath.hpp" +smPathSegment::smPathSegment(smvec2d _a,smvec2d _b){a=_a,b=_b;} +smvec2d smPathSegment::getPointOnPath(double percentage) +{return a+percentage*(b-a);} +double smPathSegment::getPathLength() +{return (a-b).l();} +smPathCircular::smPathCircular(smvec2d _ctr,double _a,double _b,double _r) +{ctr=_ctr,a=_a,b=_b,r=_r;} +smvec2d smPathCircular::getPointOnPath(double percentage) +{return smvec2d(ctr.x+r*cos(a+percentage*(b-a)),ctr.y+r*sin(a+percentage*(b-a)));} +double smPathCircular::getPathLength() +{return fabs(a-b)*r;} -- cgit v1.2.3