Fix sampling Curves with keyframes that have negative time value

This commit is contained in:
Wojciech Figat
2022-07-19 12:47:31 +02:00
parent 0af86d8cb8
commit 7de42c1681
2 changed files with 7 additions and 7 deletions

View File

@@ -558,7 +558,7 @@ namespace FlaxEngine
return;
}
float start = 0;
float start = Mathf.Min(Keyframes.First().Time, 0.0f);
float end = Keyframes.Last().Time;
WrapTime(ref time, start, end, loop);
@@ -589,7 +589,7 @@ namespace FlaxEngine
return;
}
float start = 0;
float start = Mathf.Min(Keyframes.First().Time, 0.0f);
float end = Keyframes.Last().Time;
WrapTime(ref time, start, end, loop);
@@ -841,7 +841,7 @@ namespace FlaxEngine
return;
}
float start = 0;
float start = Mathf.Min(Keyframes.First().Time, 0.0f);
float end = Keyframes.Last().Time;
WrapTime(ref time, start, end, loop);
@@ -877,7 +877,7 @@ namespace FlaxEngine
return;
}
float start = 0;
float start = Mathf.Min(Keyframes.First().Time, 0.0f);
float end = Keyframes.Last().Time;
WrapTime(ref time, start, end, loop);

View File

@@ -350,7 +350,7 @@ public:
return;
}
const float start = 0;
const float start = Math::Min(data[0].Time, 0.0f);
const float end = data[count - 1].Time;
AnimationUtils::WrapTime(time, start, end, loop);
@@ -392,7 +392,7 @@ public:
return;
}
const float start = 0;
const float start = Math::Min(data[0].Time, 0.0f);
const float end = data[count - 1].Time;
AnimationUtils::WrapTime(time, start, end, loop);
@@ -434,7 +434,7 @@ public:
return;
}
const float start = 0;
const float start = Math::Min(data[0].Time, 0.0f);
const float end = data[count - 1].Time;
AnimationUtils::WrapTime(time, start, end, loop);