Exemple #1
0
 public static Vector3Int Max(Vector3Int lhs, Vector3Int rhs)
 {
     return(new Vector3Int(Mathf.Max(lhs.x, rhs.x), Mathf.Max(lhs.y, rhs.y), Mathf.Max(lhs.z, rhs.z)));
 }
Exemple #2
0
 public static int Distance(Vector3Int a, Vector3Int b)
 {
     return((b - a).magnitude);
 }
Exemple #3
0
 public static int Magnitude(Vector3Int a)
 {
     return(Mathf.Abs(a.x) + Mathf.Abs(a.y) + Mathf.Abs(a.z));
 }
Exemple #4
0
 public static int Dot(Vector3Int lhs, Vector3Int rhs)
 {
     return(lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z);
 }
Exemple #5
0
 public static Vector3Int Reflect(Vector3Int inDirection, Vector3Int inNormal)
 {
     return(-2 * Dot(inNormal, inDirection) * inNormal + inDirection);
 }
Exemple #6
0
 public static Vector3Int Cross(Vector3Int lhs, Vector3Int rhs)
 {
     return(new Vector3Int(lhs.y * rhs.z - lhs.z * rhs.y, lhs.z * rhs.x - lhs.x * rhs.z, lhs.x * rhs.y - lhs.y * rhs.x));
 }
Exemple #7
0
 public void Scale(Vector3Int scale)
 {
     x *= scale.x;
     y *= scale.y;
     z *= scale.z;
 }
Exemple #8
0
 public static Vector3Int Scale(Vector3Int a, Vector3Int b)
 {
     return(new Vector3Int(a.x * b.x, a.y * b.y, a.z * b.z));
 }