123456789101112131415161718192021222324252627282930 |
- using UnityEngine;
- namespace FirstGearGames.Utilities.Maths
- {
- public static class Quaternions
- {
-
-
-
-
-
-
-
- public static bool Matches(this Quaternion r, Quaternion target, float? distance = null)
- {
- if (distance == null)
- {
- return (r.w == target.w && r.x == target.x && r.y == target.y && r.z == target.z);
- }
- else
- {
- float a = Vector3.SqrMagnitude(r.eulerAngles - target.eulerAngles);
- return (a <= (distance * distance));
- }
- }
- }
- }
|