small refactoring static readonly

This commit is contained in:
ikpil 2023-12-30 16:17:42 +09:00
parent b341a41fae
commit 69c1e795df
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ namespace DotRecast.Core.Numerics
public float X; public float X;
public float Y; public float Y;
public static RcVec2f Zero { get; } = new RcVec2f { X = 0, Y = 0 }; public static readonly RcVec2f Zero = new RcVec2f { X = 0, Y = 0 };
public RcVec2f(float x, float y) public RcVec2f(float x, float y)
{ {

View File

@ -27,11 +27,11 @@ namespace DotRecast.Core.Numerics
public float Y; public float Y;
public float Z; public float Z;
public static RcVec3f Zero { get; } = new RcVec3f(0.0f, 0.0f, 0.0f); public static readonly RcVec3f Zero = new RcVec3f(0.0f, 0.0f, 0.0f);
public static RcVec3f One { get; } = new RcVec3f(1.0f); public static readonly RcVec3f One = new RcVec3f(1.0f);
public static RcVec3f UnitX { get; } = new RcVec3f(1.0f, 0.0f, 0.0f); public static readonly RcVec3f UnitX = new RcVec3f(1.0f, 0.0f, 0.0f);
public static RcVec3f UnitY { get; } = new RcVec3f(0.0f, 1.0f, 0.0f); public static readonly RcVec3f UnitY = new RcVec3f(0.0f, 1.0f, 0.0f);
public static RcVec3f UnitZ { get; } = new RcVec3f(0.0f, 0.0f, 1.0f); public static readonly RcVec3f UnitZ = new RcVec3f(0.0f, 0.0f, 1.0f);
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public RcVec3f(float x, float y, float z) public RcVec3f(float x, float y, float z)