vector3f serializable

This commit is contained in:
ikpil 2023-04-01 02:01:02 +09:00
parent a01b0f8aa0
commit 921c8bed92
1 changed files with 11 additions and 4 deletions

View File

@ -23,15 +23,15 @@ namespace DotRecast.Core
{
public struct Vector3f
{
public float x;
public float y;
public float z;
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
public static Vector3f Zero { get; } = new Vector3f(0, 0, 0);
public static Vector3f Of(float[] f)
{
return new Vector3f(f[0], f[1], f[2]);
return new Vector3f(f);
}
public static Vector3f Of(float x, float y, float z)
@ -46,6 +46,13 @@ namespace DotRecast.Core
this.z = z;
}
public Vector3f(float[] f)
{
x = f[0];
y = f[1];
z = f[2];
}
public float this[int index]
{
get => GetElement(index);