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

Merge remote-tracking branch 'rmx/dev' into dev

......@@ -216,24 +216,36 @@ THREE.SkinnedMesh.prototype.pose = function () {
this.updateMatrixWorld( true );
for ( var i = 0; i < this.geometry.skinIndices.length; i ++ ) {
this.normalizeSkinWeights();
// normalize weights
};
var sw = this.geometry.skinWeights[ i ];
THREE.SkinnedMesh.prototype.normalizeSkinWeights = function () {
var scale = 1.0 / sw.lengthManhattan();
if (this.geometry instanceof THREE.Geometry) {
if ( scale !== Infinity ) {
for ( var i = 0; i < this.geometry.skinIndices.length; i ++ ) {
sw.multiplyScalar( scale );
var sw = this.geometry.skinWeights[ i ];
} else {
var scale = 1.0 / sw.lengthManhattan();
if ( scale !== Infinity ) {
sw.multiplyScalar( scale );
} else {
sw.set( 1 ); // this will be normalized by the shader anyway
sw.set( 1 ); // this will be normalized by the shader anyway
}
}
} else {
// skinning weights assumed to be normalized for THREE.BufferGeometry
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册