File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,14 @@ float Qgs3DAnimationSettings::duration() const
29
29
30
30
Qgs3DAnimationSettings::Keyframe Qgs3DAnimationSettings::interpolate ( float time ) const
31
31
{
32
- Q_ASSERT ( !mKeyframes .isEmpty () );
32
+ if ( mKeyframes .isEmpty () )
33
+ return Keyframe ();
33
34
34
- if ( time < 0 )
35
+ if ( time < mKeyframes . constFirst (). time )
35
36
{
36
37
return mKeyframes .first ();
37
38
}
38
- else if ( time >= duration () )
39
+ else if ( time >= mKeyframes . constLast (). time )
39
40
{
40
41
return mKeyframes .last ();
41
42
}
@@ -44,7 +45,7 @@ Qgs3DAnimationSettings::Keyframe Qgs3DAnimationSettings::interpolate( float time
44
45
// TODO: make easing curves configurable.
45
46
// QEasingCurve is probably not flexible enough, we may need more granular
46
47
// control with Bezier curves to allow smooth transition at keyframes
47
- QEasingCurve easing ( QEasingCurve::InOutQuad );
48
+ QEasingCurve easing ( QEasingCurve::Linear );
48
49
49
50
for ( int i = 0 ; i < mKeyframes .size () - 1 ; i++ )
50
51
{
You can’t perform that action at this time.
0 commit comments