2023-11-10 12:22:17 +01:00
|
|
|
using Godot;
|
2023-02-12 16:30:56 +01:00
|
|
|
|
2023-11-18 22:32:57 +01:00
|
|
|
public static class Globals {
|
2023-05-03 12:01:30 +02:00
|
|
|
public const float EpsPosition = 0.01f;
|
2023-02-12 16:30:56 +01:00
|
|
|
public const float EpsPositionSquared = EpsPosition * EpsPosition;
|
2023-11-10 12:22:17 +01:00
|
|
|
public const float EpsRadians = 0.1f * Mathf.Pi / 180f;
|
2023-02-12 16:30:56 +01:00
|
|
|
public const float EpsRadiansSquared = EpsRadians * EpsRadians;
|
2023-11-10 12:22:17 +01:00
|
|
|
|
2023-11-18 22:32:57 +01:00
|
|
|
public static float CalcPlaneAngle(Transform worldTransform) {
|
2023-11-10 12:22:17 +01:00
|
|
|
return worldTransform.basis.x.SignedAngleTo(Vector3.Right.Rotated(Vector3.Up, Mathf.Pi * 0.5f), -Vector3.Up);
|
|
|
|
}
|
2023-01-04 21:29:42 +01:00
|
|
|
}
|