Просмотр исходного кода

Merge pull request #8465 from RaananW/fixCannonInit

[Physics] incorrect variable assignment
sebavan 5 лет назад
Родитель
Сommit
171cfea4a1
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      dist/preview release/what's new.md
  2. 1 1
      src/Physics/Plugins/cannonJSPlugin.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -232,7 +232,7 @@
 - Make sure bone matrices are up to date when calling `TransformNode.attachToBone` ([Popov72](https://github.com/Popov72))
 - Fix display problem with transparent objects and SSAO2 pipeline (bug in the `GeometryBufferRenderer`) ([Popov72](https://github.com/Popov72))
 - Fixed `Sound` not accepting a `TransformNode` as a source for spatial sound ([Poolminer](https://github.com/Poolminer))
-- Fixed an issue with transformation set after physics body was created using cannon.js (excluding height and plane) ([#7928](https://github.com/BabylonJS/Babylon.js/issues/7928)) ([RaananW](https://github.com/RaananW))
+- Fixed an issue with transformation set after physics body was created using Cannon.js (excluding height and plane) ([#7928](https://github.com/BabylonJS/Babylon.js/issues/7928)) ([RaananW](https://github.com/RaananW))
 - Fix bug when using `ShadowOnlyMaterial` with Cascaded Shadow Map and `autoCalcDepthBounds` is `true` ([Popov72](https://github.com/Popov72))
 - Fix OBJ serializer default scene scene handedness causing [OBJ Mirror export](https://forum.babylonjs.com/t/obj-export-mirrored/10835/10)
 - Fix bug when using shadows + instances + transparent meshes + `transparencyShadow = false` ([Popov72](https://github.com/Popov72))

+ 1 - 1
src/Physics/Plugins/cannonJSPlugin.ts

@@ -537,7 +537,7 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
     public setTransformationFromPhysicsBody(impostor: PhysicsImpostor) {
         impostor.object.position.set(impostor.physicsBody.position.x, impostor.physicsBody.position.y, impostor.physicsBody.position.z);
         if (impostor.object.rotationQuaternion) {
-            const q = impostor.object.rotationQuaternion;
+            const q = impostor.physicsBody.quaternion;
             impostor.object.rotationQuaternion.set(q.x, q.y, q.z, q.w);
         }
     }