I have a wrapper entity with child entities with meshes:
<a-entity id="parent" dynamic-body="shape: none">
<a-entity id="box" geometry="primitive: box" position="1 2 3"></a-entity>
<a-entity geometry="primitive: sphere" position="3 4 5"></a-entity>
</a-entity>
I am adding the shapes with three-to-cannon and CANNON. For example with a box.
parentEl = document.querySelector('#parent');
childEl = parentEl.querySelector('#box');
parentEl.body.addShape(
mesh2shape(childEl.getObject3D('mesh'), {type: mesh2shape.Type.BOX}),
new CANNON.Vec3().copy(childEl.object3D.position),
new CANNON.Quaternion().copy(childEl.object3D.quaternion));
Since the children are offset, but the dynamic-body/shape are being added to the parent, does the above code look right to apply that? I currently have code to grab and throw objects, but the objects act very erratically (goes too fast, rolls weirdly on the ground, shakes around in the hand)