Open mattblackdev opened 2 years ago
I don't really understand the problem you are reporting.
You have 4 different physics objects inside of a group, but the group has no physics representation.
What is it supposed to be doing? Is it affecting the positions and rotations of the 4 physics bodies?
This looks to me like a single CompoundBody
with 4 shapes. Have you tried using that?
I see what you mean. I implemented parts of structures (walls, floors, etc.) and interior objects as separate components that could be composed interchangeably.
When it came time to position different compositions I tried putting them inside groups to only manage one world position per building. Problem was the groups' position didn't affect the children's colliders, only their meshes.
I get the compound body approach but it doesn't seem ideal for composing components that have their own colliders.
Thanks for giving this some thought. Cheers!
Sometimes you want to do this:
But then you learn that the physics world has no consideration of the scene hierarchy.
And you might even try to do this:
But in the end you learn that this is a harder problem to solve indeed...
So you create a repro of the issue: https://codesandbox.io/s/use-cannon-not-respecting-parent-rchms?file=/src/App.tsx
And you go back to manually managing world positions: