I have 2 configurable joints that rotates only in x-axis in the opposite direction. I had a look at this but I am not certain how to capture only the X axis value when the rotation is expressed as Quaternion.
Think of it as 2 platforms ----O---- ----O----
, O is the pivot, that must rotate in opposite direction by using targetRotation
My proposed algorithm is as follows:
- Get self initial rotation
- Get target initial rotation
- Find target current rotation
- Find the difference of target’s angle in x
- Apply the difference in current joint as a negative value
Any pointers how to obtain the x rotation value from the configurable joint and apply it to current joint?
EDIT: I figured out the first one by using Transform.localEulerAngles