Merge pull request #28581 from Lisapple/patch-1

Fixing Curve2D/3D baked interpolated values
This commit is contained in:
Rémi Verschelde 2019-05-28 10:56:00 +02:00 committed by GitHub
commit 335111c98f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -782,7 +782,8 @@ Vector2 Curve2D::interpolate_baked(float p_offset, bool p_cubic) const {
if (idx >= bpc - 1) {
return r[bpc - 1];
} else if (idx == bpc - 2) {
frac /= Math::fmod(baked_max_ofs, bake_interval);
if (frac > 0)
frac /= Math::fmod(baked_max_ofs, bake_interval);
} else {
frac /= bake_interval;
}
@ -1352,7 +1353,8 @@ Vector3 Curve3D::interpolate_baked(float p_offset, bool p_cubic) const {
if (idx >= bpc - 1) {
return r[bpc - 1];
} else if (idx == bpc - 2) {
frac /= Math::fmod(baked_max_ofs, bake_interval);
if (frac > 0)
frac /= Math::fmod(baked_max_ofs, bake_interval);
} else {
frac /= bake_interval;
}
@ -1396,7 +1398,8 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const {
if (idx >= bpc - 1) {
return r[bpc - 1];
} else if (idx == bpc - 2) {
frac /= Math::fmod(baked_max_ofs, bake_interval);
if (frac > 0)
frac /= Math::fmod(baked_max_ofs, bake_interval);
} else {
frac /= bake_interval;
}