From 6f4f9aa6ded6da027c84cc466c767334dc3d3362 Mon Sep 17 00:00:00 2001 From: Ferenc Arn Date: Sat, 14 Jan 2017 14:35:39 -0600 Subject: Overloaded basic math funcs (double and float variants). Use real_t rather than float or double in generic functions (core/math) whenever possible. Also inlined some more math functions. --- core/math/vector3.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'core/math/vector3.h') diff --git a/core/math/vector3.h b/core/math/vector3.h index 9ae9b69dfa..a289f9bf4c 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -79,17 +79,17 @@ struct Vector3 { _FORCE_INLINE_ void zero(); - void snap(float p_val); - Vector3 snapped(float p_val) const; + void snap(real_t p_val); + Vector3 snapped(real_t p_val) const; - void rotate(const Vector3& p_axis,float p_phi); - Vector3 rotated(const Vector3& p_axis,float p_phi) const; + void rotate(const Vector3& p_axis,real_t p_phi); + Vector3 rotated(const Vector3& p_axis,real_t p_phi) const; /* Static Methods between 2 vector3s */ - _FORCE_INLINE_ Vector3 linear_interpolate(const Vector3& p_b,float p_t) const; - Vector3 cubic_interpolate(const Vector3& p_b,const Vector3& p_pre_a, const Vector3& p_post_b,float p_t) const; - Vector3 cubic_interpolaten(const Vector3& p_b,const Vector3& p_pre_a, const Vector3& p_post_b,float p_t) const; + _FORCE_INLINE_ Vector3 linear_interpolate(const Vector3& p_b,real_t p_t) const; + Vector3 cubic_interpolate(const Vector3& p_b,const Vector3& p_pre_a, const Vector3& p_post_b,real_t p_t) const; + Vector3 cubic_interpolaten(const Vector3& p_b,const Vector3& p_pre_a, const Vector3& p_post_b,real_t p_t) const; _FORCE_INLINE_ Vector3 cross(const Vector3& p_b) const; _FORCE_INLINE_ real_t dot(const Vector3& p_b) const; @@ -195,7 +195,7 @@ Vector3 Vector3::ceil() const { return Vector3( Math::ceil(x), Math::ceil(y), Math::ceil(z) ); } -Vector3 Vector3::linear_interpolate(const Vector3& p_b,float p_t) const { +Vector3 Vector3::linear_interpolate(const Vector3& p_b,real_t p_t) const { return Vector3( x+(p_t * (p_b.x-x)), -- cgit v1.2.3