|
@@ -16,9 +16,9 @@ function createAnimation(){
|
|
|
|
|
|
var mixer = new AnimationMixer(new Object3D());
|
|
var mixer = new AnimationMixer(new Object3D());
|
|
var track = new NumberKeyframeTrack( ".rotation[x]", [ 0, 1000 ], [ 0, 360 ] );
|
|
var track = new NumberKeyframeTrack( ".rotation[x]", [ 0, 1000 ], [ 0, 360 ] );
|
|
- var clip = new AnimationClip( "clip1", 1000, [track] );
|
|
|
|
|
|
+ var clip = new AnimationClip( "clip1", 1000, [track] );
|
|
|
|
|
|
- var animationAction = new AnimationAction( mixer, clip );
|
|
|
|
|
|
+ var animationAction = new AnimationAction( mixer, clip );
|
|
return { mixer :mixer,track:track,clip:clip,animationAction:animationAction};
|
|
return { mixer :mixer,track:track,clip:clip,animationAction:animationAction};
|
|
|
|
|
|
}
|
|
}
|
|
@@ -189,7 +189,26 @@ export default QUnit.module( 'Animation', () => {
|
|
mixer.update(1000);
|
|
mixer.update(1000);
|
|
assert.ok( animationAction.isRunning(), "When an animation is in third loop when in looprepeat 3 times, it is running." );
|
|
assert.ok( animationAction.isRunning(), "When an animation is in third loop when in looprepeat 3 times, it is running." );
|
|
mixer.update(1000);
|
|
mixer.update(1000);
|
|
- assert.notOk( animationAction.isRunning(), "When an animation ended his third loop when in looprepeat 3 times, it is not running anymore." );
|
|
|
|
|
|
+ assert.ok( animationAction.isRunning(), "When an animation is in fourth loop when in looprepeat 3 times, it is running." );
|
|
|
|
+ mixer.update(1000);
|
|
|
|
+ assert.notOk( animationAction.isRunning(), "When an animation ended his third loop when in looprepeat 3 times, it stays not running anymore." );
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+
|
|
|
|
+ QUnit.test( "setLoop LoopPingPong", ( assert ) => {
|
|
|
|
+
|
|
|
|
+ var {mixer,animationAction} = createAnimation();
|
|
|
|
+ animationAction.setLoop(LoopPingPong,3);
|
|
|
|
+ animationAction.play();
|
|
|
|
+ assert.ok( animationAction.isRunning(), "When an animation is started, it is running." );
|
|
|
|
+ mixer.update(500);
|
|
|
|
+ assert.ok( animationAction.isRunning(), "When an animation is in the first loop, it is running." );
|
|
|
|
+ mixer.update(1000);
|
|
|
|
+ assert.ok( animationAction.isRunning(), "When an animation is in second loop when in looprepeat 3 times, it is running." );
|
|
|
|
+ mixer.update(1000);
|
|
|
|
+ assert.ok( animationAction.isRunning(), "When an animation is in third loop when in looprepeat 3 times, it is running." );
|
|
|
|
+ mixer.update(1000);
|
|
|
|
+ assert.ok( animationAction.isRunning(), "When an animation is in fourth loop when in looprepeat 3 times, it is running." );
|
|
mixer.update(1000);
|
|
mixer.update(1000);
|
|
assert.notOk( animationAction.isRunning(), "When an animation ended his third loop when in looprepeat 3 times, it stays not running anymore." );
|
|
assert.notOk( animationAction.isRunning(), "When an animation ended his third loop when in looprepeat 3 times, it stays not running anymore." );
|
|
|
|
|