my problem:
I have two vectors:
- 1st vector is the direction of lever from the base of it
- 2nd vector is the direction from the base of lever to Hand position (VR hand)
My objective is to compute angle from two vectors to add this angle to lever rotation, sign permit me to determine the direction of angle. To make this calculation in Unity I use the function I said before: Vector.signedAngle(Vector from, Vector to, Vector axis).
Give my first Vector as “from” and second vector as “to” and lever axis direction as “axis”. “axis” is the referencial to compute the sign of angle. With sign, when the VR hand push the lever, the angle will be negative, and when she pull the lever, it will be positive.
other application is to get current angle of lever (to trigger events or clamp positions) by compute the angle between initial lever direction and current by the same way. If I do a Dot product and Acos and the calculation gave me 170 as result, I don’t know if it’s 170° or 190° (360° -170°)
Apparantly, with couple of days of search, a simple function to achieve this calculation don’t exists on Unreal, that a engine weakness (vector and angle calculation in general).