소스 검색

composite rotation working

Trevor Baron 6 년 전
부모
커밋
3fd0cdf092
2개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 3
      src/Physics/Plugins/babylon.ammoJSPlugin.ts
  2. 1 1
      src/Physics/babylon.physicsImpostor.ts

+ 1 - 3
src/Physics/Plugins/babylon.ammoJSPlugin.ts

@@ -206,7 +206,6 @@ module BABYLON {
             
             if(!ignoreChildren){
                 var meshChildren = impostor.object.getChildMeshes ? impostor.object.getChildMeshes(true) : [];
-                let currentRotation: Nullable<Quaternion> = impostor.object.rotationQuaternion;
                 if (meshChildren.length > 0) {
                     returnValue = new Ammo.btCompoundShape();
                     
@@ -216,10 +215,9 @@ module BABYLON {
                         if(childImpostor){
                             var shape = this._createShape(childImpostor);
                             this._tmpAmmoTransform.getOrigin().setValue(childMesh.position.x, childMesh.position.y,childMesh.position.z);
-                            this._tmpAmmoQuaternion.setValue(currentRotation!.x,currentRotation!.y,currentRotation!.z,currentRotation!.w)
+                            this._tmpAmmoQuaternion.setValue(childMesh.rotationQuaternion!.x,childMesh.rotationQuaternion!.y,childMesh.rotationQuaternion!.z,childMesh.rotationQuaternion!.w)
                             this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion)
                             returnValue.addChildShape(this._tmpAmmoTransform, shape);
-                            
                             childImpostor.dispose();
                         }
                     })

+ 1 - 1
src/Physics/babylon.physicsImpostor.ts

@@ -411,7 +411,7 @@ module BABYLON {
                 this.object.rotationQuaternion = q;
                 //calculate the world matrix with the new rotation
                 this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);
-
+                console.log(size)
                 return size;
             } else {
                 return PhysicsImpostor.DEFAULT_OBJECT_SIZE;