提交 a044dc91 编写于 作者: B Ben Houston

fix bug where the keyframe track couldn't get back to the first key.

上级 a95ec4d4
......@@ -42,18 +42,22 @@ THREE.KeyframeTrack.prototype = {
this.lastIndex ++;
};
// this can not go lower than 0.
while( ( this.lastIndex > 0 ) && ( time < this.keys[this.lastIndex - 1].time ) ) {
this.lastIndex --;
}
//if( /morph/i.test( this.name ) ) {
// console.log( "lastIndex: ", this.lastIndex );
//}
if( this.lastIndex >= this.keys.length ) {
this.setResult( this.keys[ this.lastIndex - 1 ].value );
this.setResult( this.keys[ this.keys.length - 1 ].value );
return this.result;
}
// this can not go lower than 0.
while( ( this.lastIndex > 0 ) && ( time < this.keys[this.lastIndex - 1].time ) ) {
this.lastIndex --;
}
if( this.lastIndex === 0 ) {
this.setResult( this.keys[ 0 ].value );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册