summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-07-24 11:44:42 -0300
committerGitHub <noreply@github.com>2016-07-24 11:44:42 -0300
commitbafcabb15714b03ab5f381066017793a91cb7591 (patch)
tree1a619d6202658649ecd5928ba80801f7cebc8db2 /scene/resources
parent8fbe804bd17f919f53daae70a229c07ca4d8a355 (diff)
parent2b608846594bc69a20f8945c6f61bdb9319b2fdb (diff)
Merge pull request #5832 from Algrin6/patch-1
Fixes defects in Curve2D and Curve3D
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/curve.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index 88ff09e961..29460790ff 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -644,7 +644,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset,bool p_cubic) const{
if (p_offset>=baked_max_ofs)
return r[bpc-1];
- int idx = Math::floor(p_offset/bake_interval);
+ int idx = Math::floor((double)p_offset/(double)bake_interval);
float frac = Math::fmod(p_offset,bake_interval);
if (idx>=bpc-1) {
@@ -1117,7 +1117,7 @@ Vector3 Curve3D::interpolate_baked(float p_offset,bool p_cubic) const{
if (p_offset>=baked_max_ofs)
return r[bpc-1];
- int idx = Math::floor(p_offset/bake_interval);
+ int idx = Math::floor((double)p_offset/(double)bake_interval);
float frac = Math::fmod(p_offset,bake_interval);
if (idx>=bpc-1) {
@@ -1161,7 +1161,7 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const{
if (p_offset>=baked_max_ofs)
return r[bpc-1];
- int idx = Math::floor(p_offset/bake_interval);
+ int idx = Math::floor((double)p_offset/(double)bake_interval);
float frac = Math::fmod(p_offset,bake_interval);
if (idx>=bpc-1) {