未验证 提交 570bb8b1 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #13016 from gero3/UnitTestsAnimationAction

Add unit test for clipTime in AnimationAtion
......@@ -16,9 +16,9 @@ function createAnimation(){
var mixer = new AnimationMixer(new Object3D());
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};
}
......@@ -189,7 +189,26 @@ export default QUnit.module( 'Animation', () => {
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.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);
assert.notOk( animationAction.isRunning(), "When an animation ended his third loop when in looprepeat 3 times, it stays not running anymore." );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册