Raanan Weber 9 năm trước cách đây
mục cha
commit
a792af3ae9

+ 2 - 2
src/Physics/Plugins/babylon.cannonJSPlugin.js

@@ -34,8 +34,8 @@ var BABYLON;
                             var translation = mesh.getBoundingInfo().boundingBox.center.subtract(center).subtract(mesh.position).negate();
                             body.position = new CANNON.Vec3(translation.x, translation.y - mesh.getBoundingInfo().boundingBox.extendSize.y, translation.z);
                             //add it inverted to the delta 
-                            registeredMesh.deltaPosition = mesh.getBoundingInfo().boundingBox.center.subtract(center);
-                            registeredMesh.deltaPosition.y += mesh.getBoundingInfo().boundingBox.extendSize.y;
+                            registeredMesh.delta = mesh.getBoundingInfo().boundingBox.center.subtract(center);
+                            registeredMesh.delta.y += mesh.getBoundingInfo().boundingBox.extendSize.y;
                             mesh.setPivotMatrix(oldPivot);
                             mesh.computeWorldMatrix(true);
                         }

+ 2 - 2
src/Physics/Plugins/babylon.cannonJSPlugin.ts

@@ -396,8 +396,8 @@
                         
                         body.position = new CANNON.Vec3(translation.x, translation.y - mesh.getBoundingInfo().boundingBox.extendSize.y, translation.z);
                         //add it inverted to the delta 
-                        registeredMesh.deltaPosition = mesh.getBoundingInfo().boundingBox.center.subtract(center);
-                        registeredMesh.deltaPosition.y += mesh.getBoundingInfo().boundingBox.extendSize.y;
+                        registeredMesh.delta = mesh.getBoundingInfo().boundingBox.center.subtract(center);
+                        registeredMesh.delta.y += mesh.getBoundingInfo().boundingBox.extendSize.y;
                         
                         mesh.setPivotMatrix(oldPivot);
                         mesh.computeWorldMatrix(true);