summaryrefslogtreecommitdiff
path: root/core/math/vector3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/vector3.cpp')
-rw-r--r--core/math/vector3.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp
index 4a9b251406..568df48c62 100644
--- a/core/math/vector3.cpp
+++ b/core/math/vector3.cpp
@@ -85,10 +85,12 @@ Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a,
real_t bc = p1.distance_to(p2);
real_t cd = p2.distance_to(p3);
- if (ab > 0)
+ if (ab > 0) {
p0 = p1 + (p0 - p1) * (bc / ab);
- if (cd > 0)
+ }
+ if (cd > 0) {
p3 = p2 + (p3 - p2) * (bc / cd);
+ }
}
real_t t = p_t;