After extensively searching and reviewing issues and documentation, it seems that apart from establishing a constraint between two Cannon bodies, there is no direct method to unite shapes of varying masses.
Currently, I am using the lockConstraint
approach, but I consider it to be a temporary solution. Occasionally, when my object collides, the rotation of the "child" object abruptly shifts to an unintended position...
Is there a more appropriate way to accomplish this?
Edit: My goal is to create a vehicle with the center of mass aligned with the center of the 4 wheels.
To achieve this, I have set up a body with .collisionResponse
set to 0 and the desired mass, positioning it at the center of the wheels.
Subsequently, I establish the chassis with minimal mass and a new
CANNON.LockConstraint(chassisBody, mass, 0.5)
to effectively link the two objects together.