提交 091b1f79 编写于 作者: M Mr.doob

Clean up.

上级 b81cbbe2
......@@ -47,8 +47,8 @@ THREE.MorphAnimation.prototype = {
this.currentTime = Math.min( this.currentTime, this.duration );
var interpolation = this.duration / this.frames;
var frame = Math.floor( this.currentTime / interpolation );
var frameTime = this.duration / this.frames;
var frame = Math.floor( this.currentTime / frameTime );
var influences = this.mesh.morphTargetInfluences;
......@@ -63,8 +63,10 @@ THREE.MorphAnimation.prototype = {
}
influences[ frame ] = ( this.currentTime % interpolation ) / interpolation;
influences[ this.lastFrame ] = 1 - influences[ frame ];
var mix = ( this.currentTime % frameTime ) / frameTime;
influences[ frame ] = mix;
influences[ this.lastFrame ] = 1 - mix;
}
......
......@@ -22,7 +22,7 @@ THREE.MorphAnimMesh = function ( geometry, material ) {
this.direction = 1;
this.directionBackwards = false;
this.setFrameRange( 0, this.geometry.morphTargets.length - 1 );
this.setFrameRange( 0, geometry.morphTargets.length - 1 );
};
......@@ -152,12 +152,13 @@ THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) {
var keyframe = this.startKeyframe + THREE.Math.clamp( Math.floor( this.time / frameTime ), 0, this.length - 1 );
if ( keyframe !== this.currentKeyframe ) {
var influences = this.morphTargetInfluences;
this.morphTargetInfluences[ this.lastKeyframe ] = 0;
this.morphTargetInfluences[ this.currentKeyframe ] = 1;
if ( keyframe !== this.currentKeyframe ) {
this.morphTargetInfluences[ keyframe ] = 0;
influences[ this.lastKeyframe ] = 0;
influences[ this.currentKeyframe ] = 1;
influences[ keyframe ] = 0;
this.lastKeyframe = this.currentKeyframe;
this.currentKeyframe = keyframe;
......@@ -172,8 +173,8 @@ THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) {
}
this.morphTargetInfluences[ this.currentKeyframe ] = mix;
this.morphTargetInfluences[ this.lastKeyframe ] = 1 - mix;
influences[ this.currentKeyframe ] = mix;
influences[ this.lastKeyframe ] = 1 - mix;
};
......
......@@ -308,7 +308,6 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
}
_renderer.setMaterialFaces( objectMaterial );
_renderer.renderBufferDirect( shadowCamera, _lights, fog, material, object );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册