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

Merge pull request #13968 from takahirox/MMDPhysicsMinorOptimization

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