34 lines
857 B
C#
34 lines
857 B
C#
#if !UNITY_5_3_OR_NEWER
|
|
using System;
|
|
|
|
#if !UNITY_5_3_OR_NEWER
|
|
namespace Passer.LinearAlgebra {
|
|
public class Vector3Of<T> {
|
|
public T x;
|
|
public T y;
|
|
public T z;
|
|
|
|
public Vector3Of(T x, T y, T z) {
|
|
this.x = x;
|
|
this.y = y;
|
|
this.z = z;
|
|
}
|
|
|
|
// public uint magnitude {
|
|
// get => (float)Math.Sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
// }
|
|
}
|
|
|
|
public class Vector3Int : Vector3Of<int> {
|
|
public Vector3Int(int x, int y, int z) : base(x, y, z) { }
|
|
}
|
|
public class Vector3Float : Vector3Of<float> {
|
|
public Vector3Float(float x, float y, float z) : base(x, y, z) { }
|
|
|
|
public float magnitude {
|
|
get => (float)Math.Sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |