forked from bit/DotRecastNetSim
vector3f serializable
This commit is contained in:
parent
a01b0f8aa0
commit
921c8bed92
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue