diff options
Diffstat (limited to 'intern/moto/include/MT_Scalar.h')
-rw-r--r-- | intern/moto/include/MT_Scalar.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/intern/moto/include/MT_Scalar.h b/intern/moto/include/MT_Scalar.h index 5e516292d77..93bd1a2e3ab 100644 --- a/intern/moto/include/MT_Scalar.h +++ b/intern/moto/include/MT_Scalar.h @@ -52,7 +52,7 @@ #include "MT_random.h" -typedef double MT_Scalar; //this should be float ! +typedef float MT_Scalar; const MT_Scalar MT_DEGS_PER_RAD(57.29577951308232286465); @@ -64,20 +64,20 @@ const MT_Scalar MT_EPSILON2(1.0e-20); const MT_Scalar MT_INFINITY(1.0e50); inline int MT_sign(MT_Scalar x) { - return x < 0.0 ? -1 : x > 0.0 ? 1 : 0; + return x < 0.0f ? -1 : x > 0.0f ? 1 : 0; } inline MT_Scalar MT_abs(MT_Scalar x) { return fabs(x); } -inline bool MT_fuzzyZero(MT_Scalar x) { return MT_abs(x) < MT_EPSILON; } -inline bool MT_fuzzyZero2(MT_Scalar x) { return MT_abs(x) < MT_EPSILON2; } +inline bool MT_fuzzyZero(MT_Scalar x) { return MT_abs(x) < (float)MT_EPSILON; } +inline bool MT_fuzzyZero2(MT_Scalar x) { return MT_abs(x) < (float)MT_EPSILON2; } inline MT_Scalar MT_radians(MT_Scalar x) { - return x * MT_RADS_PER_DEG; + return x * (float)MT_RADS_PER_DEG; } inline MT_Scalar MT_degrees(MT_Scalar x) { - return x * MT_DEGS_PER_RAD; + return x * (float)MT_DEGS_PER_RAD; } inline MT_Scalar MT_random() { |