# Compound to Empty Mesh Demo works differently for Cannon & Omio vs Ammo

**URL:** <https://forum.babylonjs.com/t/compound-to-empty-mesh-demo-works-differently-for-cannon-omio-vs-ammo/29062>\
**Category:** Questions\
**Created:** [April 4, 2022, 3:37pm UTC](https://forum.babylonjs.com/t/compound-to-empty-mesh-demo-works-differently-for-cannon-omio-vs-ammo/29062 "2022-04-04T15:37:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [April 4, 2022, 3:37pm UTC](https://forum.babylonjs.com/t/compound-to-empty-mesh-demo-works-differently-for-cannon-omio-vs-ammo/29062/1 "2022-04-04T15:37:08Z")

</div>

Ammo seems to be the only one that works correctly given this setup the others treat the position of the parent mesh as an offset?

> **[Babylon.js Playground](https://playground.babylonjs.com/#492ZK0%237)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

This is the demo scene from the documents “Compound to Empty Mesh”

> **[Compound Bodies | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/physics/compoundBodies)**
>
> Learn all about physics compound bodies in Babylon.js.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 4, 2022, 3:54pm UTC](https://forum.babylonjs.com/t/compound-to-empty-mesh-demo-works-differently-for-cannon-omio-vs-ammo/29062/2 "2022-04-04T15:54:31Z")

</div>

cc @Cedric

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [April 5, 2022, 10:27am UTC](https://forum.babylonjs.com/t/compound-to-empty-mesh-demo-works-differently-for-cannon-omio-vs-ammo/29062/3 "2022-04-05T10:27:12Z")

</div>

PR

> <https://github.com/BabylonJS/Babylon.js/pull/12337>
>
> followup https://forum.babylonjs.com/t/compound-to-empty-mesh-demo-works-differe…ntly-for-cannon-omio-vs-ammo/29062
> 
> When computing bounding info from scratch, before this change, the min and max position was \`mesh.position\`. So, in this case:
> \`\`\`
> var compoundBody = new BABYLON.Mesh("compoundBody", scene);
> compoundBody.position.y=3;
> 
> compoundBody.computeWorldMatrix(true);
> console.log(compoundBody.getBoundingInfo().boundingSphere.centerWorld.y);
> console.log(compoundBody.position.y);
> \`\`\`
> min and max are (0,3,0), bouding sphere local center is (0,3,0).
> world bounding sphere center is local center transformed by world matrix and its value is (0,6, 0) which is not correct. It breaks the physics for oimo and cannon. Computation is different with ammo and was not touched by this issue.
> 
> 
> @RaananW Git blame indicates you changed it last. Do you remember why/what it fixed?
