Bläddra i källkod

composite rotation working

Trevor Baron 6 år sedan
förälder
incheckning
3fd0cdf092

+ 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;