diff options
author | Ferenc Arn <tagcup@yahoo.com> | 2017-01-14 14:35:39 -0600 |
---|---|---|
committer | Ferenc Arn <tagcup@yahoo.com> | 2017-01-16 13:36:33 -0600 |
commit | 6f4f9aa6ded6da027c84cc466c767334dc3d3362 (patch) | |
tree | 4d45d7e600a069d7feb2a2dae3a70d6b9ddbf884 /core/math/vector3.h | |
parent | d13f2f9e25e380496e706b59720cd85eed299ca2 (diff) | |
download | redot-engine-6f4f9aa6ded6da027c84cc466c767334dc3d3362.tar.gz |
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.
Diffstat (limited to 'core/math/vector3.h')
-rw-r--r-- | core/math/vector3.h | 16 |
1 files changed, 8 insertions, 8 deletions
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)), |