Class MapGestureMath
Pure gesture math shared by input controllers, testable without an editor.
public static class MapGestureMath
- Inheritance
-
objectMapGestureMath
Methods
NormalizeDeg(double)
Wraps a bearing into [0, 360) degrees.
public static double NormalizeDeg(double degrees)
Parameters
degreesdoubleBearing in degrees, any magnitude.
Returns
- double
Equivalent bearing in [0, 360) degrees.
Remarks
Unbounded accumulation (rotate one direction indefinitely) drifts double precision over very large magnitudes; callers that accumulate rotation via repeated addition should wrap through this after every write.
TwistRotationDeltaDeg(double, double)
Shortest signed rotation from one finger angle to the next.
public static double TwistRotationDeltaDeg(double prevAngleDeg, double angleDeg)
Parameters
prevAngleDegdoublePrevious finger angle in degrees.
angleDegdoubleCurrent finger angle in degrees.
Returns
- double
Signed sweep in (-180, 180] degrees.
Remarks
Wrap-safe. Fed by a y-up Atan2 finger angle, so a counter-clockwise twist yields a positive delta and map rotation follows the fingers.