X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FMath.hh;h=d557c7f15114d7a07e15d393cbd66728bfba1f76;hp=429320768c98aae2b1adf4a7643cf9095acb2f50;hb=4107dd30ca1a4c7d1a5cd6c0999b9afb5adff779;hpb=58c1f9a499d3bb80ea2869b29c714f61e656d48d diff --git a/src/Moof/Math.hh b/src/Moof/Math.hh index 4293207..d557c7f 100644 --- a/src/Moof/Math.hh +++ b/src/Moof/Math.hh @@ -85,7 +85,7 @@ inline Vector3 promote(const Vector2& vec, Scalar extra = 0.0) } -template +template inline R convert(const P& p) { return R(p); @@ -115,11 +115,11 @@ inline Vector3 convert(const Vector2& vec) return Vector3(vec[0], vec[1], SCALAR(0.0)); } -template +template struct cast { cast(const P& p) : param(p) {} - template + template operator R() { return convert(param); } private: const P& param; @@ -153,7 +153,7 @@ inline bool isEqual(Scalar a, Scalar b, Scalar epsilon = EPSILON) // Derivative_Type operator+(const Derivative_Type& other) const // Derivative_Type operator*(const Derivative_Type& other) const -template +template inline D evaluate(const S& state, Scalar t) { D derivative; @@ -161,7 +161,7 @@ inline D evaluate(const S& state, Scalar t) return derivative; } -template +template inline D evaluate(S state, Scalar t, Scalar dt, const D& derivative) { state.step(derivative, dt); @@ -169,7 +169,7 @@ inline D evaluate(S state, Scalar t, Scalar dt, const D& derivative) } -template +template inline void euler(S& state, Scalar t, Scalar dt) { D a = evaluate(state, t); @@ -177,7 +177,7 @@ inline void euler(S& state, Scalar t, Scalar dt) state.step(a, dt); } -template +template inline void rk2(S& state, Scalar t, Scalar dt) { D a = evaluate(state, t); @@ -186,7 +186,7 @@ inline void rk2(S& state, Scalar t, Scalar dt) state.step(b, dt); } -template +template inline void rk4(S& state, Scalar t, Scalar dt) { D a = evaluate(state, t);