X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fmath.hh;h=e72dec0bbd1853992131253f7e2ef7da4203efd0;hp=e7cd3f03951f873c04ec37dcb3e02a91993f78e6;hb=44b3014bce798789e795242d1556cb7449e6386a;hpb=574af38ed616d1adfa5e6ce35f67cda1f707f89d diff --git a/src/moof/math.hh b/src/moof/math.hh index e7cd3f0..e72dec0 100644 --- a/src/moof/math.hh +++ b/src/moof/math.hh @@ -10,19 +10,17 @@ #ifndef _MOOF_MATH_HH_ #define _MOOF_MATH_HH_ -/** - * \file math.hh - * General math-related types and functions. - */ +#include + +#include +#include + +#include #if HAVE_CONFIG_H #include "config.h" #endif -#include - -#include -#include #if ENABLE_DOUBLE_PRECISION typedef GLdouble GLscalar; @@ -35,6 +33,11 @@ typedef GLfloat GLscalar; #endif +/** + * \file math.hh + * General math-related types and functions. + */ + namespace moof { @@ -137,7 +140,7 @@ inline void rk4(S& state, scalar t, scalar dt) D b = evaluate(state, t, dt * SCALAR(0.5), a); D c = evaluate(state, t, dt * SCALAR(0.5), b); D d = evaluate(state, t, dt, c); - state.step((a + (b + c) * SCALAR(2.0) + d) * SCALAR(1.0/6.0), dt); + state.step((a + (b + c) * SCALAR(2.0) + d) * (SCALAR(1.0)/SCALAR(6.0)), dt); }