This commit is contained in:
MrTorex committed 2026-02-10 12:35:10 +03:00
1 parent a70076ebe9
commit 854835878c
20 files changed
+2542

No files matched your search

+22
View File
@@ -21,5 +21,27 @@ namespace Code.Base
{
return new Steering();
}
public float MapToRange(float rotation)
{
rotation %= 360;
if (Mathf.Abs(rotation) <= 180) return rotation;
if (rotation < 0)
rotation += 360;
else
rotation -= 360;
return rotation;
}
public Vector3 GetOriAsVec(float orientation)
{
var vector = Vector3.zero;
vector.x = Mathf.Sin(orientation * Mathf.Deg2Rad) * 1;
vector.z = Mathf.Cos(orientation * Mathf.Deg2Rad) * 1;
return vector.normalized;
}
}
}