@fabienrohrer san.
If somebody finds a better way, I would be happy to get it too
Actually, I’ve tried it too.
I would be happy if it was helpful.
These two examples are attempts to create joints to maintain 90 degree orientation.
The first is a case where the calculation breaks down under the specified conditions.
The second case is one that can always be maintained, but a negative angle cannot be specified.
It may be necessary to know how to express the state of m1 in the coordinate system of m0.
It might be a good idea to request a general-purpose function to find the angle between two objects from the Babylon.js community.