You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Cleanup unused engine code
This commit is contained in:
@@ -72,39 +72,6 @@ Vector3 Vector3::snapped(Vector3 p_val) const {
|
||||
return v;
|
||||
}
|
||||
|
||||
Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_weight) const {
|
||||
Vector3 p0 = p_pre_a;
|
||||
Vector3 p1 = *this;
|
||||
Vector3 p2 = p_b;
|
||||
Vector3 p3 = p_post_b;
|
||||
|
||||
{
|
||||
//normalize
|
||||
|
||||
real_t ab = p0.distance_to(p1);
|
||||
real_t bc = p1.distance_to(p2);
|
||||
real_t cd = p2.distance_to(p3);
|
||||
|
||||
if (ab > 0) {
|
||||
p0 = p1 + (p0 - p1) * (bc / ab);
|
||||
}
|
||||
if (cd > 0) {
|
||||
p3 = p2 + (p3 - p2) * (bc / cd);
|
||||
}
|
||||
}
|
||||
|
||||
real_t t = p_weight;
|
||||
real_t t2 = t * t;
|
||||
real_t t3 = t2 * t;
|
||||
|
||||
Vector3 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, const Vector3 &p_post_b, real_t p_weight) const {
|
||||
Vector3 p0 = p_pre_a;
|
||||
Vector3 p1 = *this;
|
||||
|
||||
Reference in New Issue
Block a user