Changed static readonly to const

This commit is contained in:
ikpil 2024-07-04 23:34:25 +09:00
parent fa2ff6f133
commit 4743ba68f9
6 changed files with 16 additions and 16 deletions

View File

@ -6,7 +6,7 @@ namespace DotRecast.Core.Numerics
public static class RcVec
{
public const float EPSILON = 1e-6f;
private static readonly float EQUAL_THRESHOLD = RcMath.Sqr(1.0f / 16384.0f);
public static readonly float EQUAL_THRESHOLD = RcMath.Sqr(1.0f / 16384.0f);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static RcVec3f Create(Span<float> values, int n)

View File

@ -28,7 +28,7 @@ namespace DotRecast.Detour
*/
public static class DtConvexConvexIntersections
{
private static readonly float EPSILON = 0.0001f;
private const float EPSILON = 0.0001f;
public static float[] Intersect(float[] p, float[] q)
{

View File

@ -326,9 +326,9 @@ public class DebugDraw
}
}
private static readonly int NUM_ARC_PTS = 8;
private static readonly float PAD = 0.05f;
private static readonly float ARC_PTS_SCALE = (1.0f - PAD * 2) / NUM_ARC_PTS;
private const int NUM_ARC_PTS = 8;
private const float PAD = 0.05f;
private const float ARC_PTS_SCALE = (1.0f - PAD * 2) / NUM_ARC_PTS;
public void AppendArc(float x0, float y0, float z0, float x1, float y1, float z1, float h, float as0, float as1, int col)
{

View File

@ -33,9 +33,9 @@ using static DtDetour;
public class RecastDebugDraw : DebugDraw
{
public static readonly int DU_DRAWNAVMESH_OFFMESHCONS = 0x01;
public static readonly int DU_DRAWNAVMESH_CLOSEDLIST = 0x02;
public static readonly int DU_DRAWNAVMESH_COLOR_TILES = 0x04;
public const int DU_DRAWNAVMESH_OFFMESHCONS = 0x01;
public const int DU_DRAWNAVMESH_CLOSEDLIST = 0x02;
public const int DU_DRAWNAVMESH_COLOR_TILES = 0x04;
public RecastDebugDraw(GL gl) : base(gl)
{

View File

@ -34,12 +34,12 @@ namespace DotRecast.Recast.Toolset.Builder
public const int SAMPLE_POLYAREA_TYPE_JUMP_AUTO = 0x6;
public const int SAMPLE_POLYAREA_TYPE_WALKABLE = 0x3f;
public static readonly int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road)
public static readonly int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water).
public static readonly int SAMPLE_POLYFLAGS_DOOR = 0x04; // Ability to move through doors.
public static readonly int SAMPLE_POLYFLAGS_JUMP = 0x08; // Ability to jump.
public static readonly int SAMPLE_POLYFLAGS_DISABLED = 0x10; // Disabled polygon
public static readonly int SAMPLE_POLYFLAGS_ALL = 0xffff; // All abilities.
public const int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road)
public const int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water).
public const int SAMPLE_POLYFLAGS_DOOR = 0x04; // Ability to move through doors.
public const int SAMPLE_POLYFLAGS_JUMP = 0x08; // Ability to jump.
public const int SAMPLE_POLYFLAGS_DISABLED = 0x10; // Disabled polygon
public const int SAMPLE_POLYFLAGS_ALL = 0xffff; // All abilities.
public static readonly RcAreaModification SAMPLE_AREAMOD_WALKABLE = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WALKABLE);
public static readonly RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND);

View File

@ -4,8 +4,8 @@ namespace DotRecast.Recast.Toolset.Gizmos
{
public static class RcGizmoHelper
{
private static readonly int SEGMENTS = 16;
private static readonly int RINGS = 8;
private const int SEGMENTS = 16;
private const int RINGS = 8;
private static float[] sphericalVertices;