As represented in the image below, I have a THREE.Scene
with a simple cube. Attached to the cube is a CANNON.Body
for Physics (represented in the green wireframe).
The CANNON.Body
is offset from the cube by a couple of units. For rotation, this offset will be the radius.
When I rotate the cube, I want the CANNON.Body
to rotate around the cube based on the angle and radius. On the right hand side of the image, I rotated the cube with an angle of 45 degrees (I also have radians available). However, the CANNON.Body
does not rotate around the cube, only around it's own center. I need it to rotate around the cube for all axes x, y and z.
Is there a built-in function in THREE.js
or should I use my own mathematical equation for this? If so, what would that be?
Thanks!
P.S. I've seen solutions for pure THREE.js
Scene's where the geometry is translated to manipulate the pivot point. Since I don't have geometry in my CANNON.Body
, this will not be possible.