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

Merge pull request #13968 from takahirox/MMDPhysicsMinorOptimization

MMDPhysics minor optimization
......@@ -814,9 +814,9 @@ THREE.MMDPhysics.RigidBody.prototype = {
var helper = this.helper;
var p = helper.allocThreeVector3();
var q = helper.allocThreeQuaternion();
var s = helper.allocThreeVector3();
this.bone.getWorldPosition( p );
this.bone.getWorldQuaternion( q );
this.bone.matrixWorld.decompose( p, q, s );
var tr = helper.allocTransform();
helper.setOriginFromThreeVector3( tr, p );
......@@ -825,6 +825,7 @@ THREE.MMDPhysics.RigidBody.prototype = {
var form = helper.multiplyTransforms( tr, this.boneOffsetForm );
helper.freeTransform( tr );
helper.freeThreeVector3( s );
helper.freeThreeQuaternion( q );
helper.freeThreeVector3( p );
......@@ -881,8 +882,6 @@ THREE.MMDPhysics.RigidBody.prototype = {
updateBoneRotation: function () {
this.bone.updateMatrixWorld( true );
var helper = this.helper;
var tr = this.getWorldTransformForBone();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册