summaryrefslogtreecommitdiffstats
path: root/core/math/vector3.h
diff options
context:
space:
mode:
authorAlexander Alekseev <alexander.n.alekseev@gmail.com>2018-05-04 10:24:48 +0300
committerAlexander Alekseev <alexander.n.alekseev@gmail.com>2018-05-04 12:43:50 +0300
commit26963473a9d832f18e05db074577511d2477a42a (patch)
tree4aa688c35d6aaa61d544312b7b2b61de53119be6 /core/math/vector3.h
parentd6ddfdf004a1b5a334a0709e87e2e427624e616b (diff)
downloadredot-engine-26963473a9d832f18e05db074577511d2477a42a.tar.gz
Vector3::round, Vector2::round & Vector2::ceil methods were added.
Now both structs (Vector2 & Vector3) have round, floor & ceil methods. (see #18603)
Diffstat (limited to 'core/math/vector3.h')
-rw-r--r--core/math/vector3.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 10ec4f5641..3bbfd7627c 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -103,6 +103,7 @@ struct Vector3 {
_FORCE_INLINE_ Vector3 floor() const;
_FORCE_INLINE_ Vector3 sign() const;
_FORCE_INLINE_ Vector3 ceil() const;
+ _FORCE_INLINE_ Vector3 round() const;
_FORCE_INLINE_ real_t distance_to(const Vector3 &p_b) const;
_FORCE_INLINE_ real_t distance_squared_to(const Vector3 &p_b) const;
@@ -204,6 +205,11 @@ Vector3 Vector3::ceil() const {
return Vector3(Math::ceil(x), Math::ceil(y), Math::ceil(z));
}
+Vector3 Vector3::round() const {
+
+ return Vector3(Math::round(x), Math::round(y), Math::round(z));
+}
+
Vector3 Vector3::linear_interpolate(const Vector3 &p_b, real_t p_t) const {
return Vector3(