Ejemplo n.º 1
0
        public override bool Equals(object other)
        {
            if (!(other is Vector4Int))
            {
                return(false);
            }

            Vector4Int rhs = (Vector4Int)other;

            return(this == rhs);
        }
Ejemplo n.º 2
0
 public void Clamp(Vector4Int min, Vector4Int max)
 {
     x = Math.Max(min.x, x);
     x = Math.Min(max.x, x);
     y = Math.Max(min.y, y);
     y = Math.Min(max.y, y);
     z = Math.Max(min.z, z);
     z = Math.Min(max.z, z);
     w = Math.Max(min.w, w);
     w = Math.Min(max.w, w);
 }
Ejemplo n.º 3
0
 // Returns a vector that is made from the smallest components of two vectors.
 public static Vector4Int Min(Vector4Int lhs, Vector4Int rhs)
 {
     return(new Vector4Int(Mathf.Min(lhs.x, rhs.x), Mathf.Min(lhs.y, rhs.y), Mathf.Min(lhs.z, rhs.z), Mathf.Min(lhs.w, rhs.w)));
 }
Ejemplo n.º 4
0
 // Returns the distance between /a/ and /b/.
 public static float Distance(Vector4Int a, Vector4Int b)
 {
     return((a - b).magnitude);
 }
Ejemplo n.º 5
0
 // Multiplies every component of this vector by the same component of /scale/.
 public void Scale(Vector4Int scale)
 {
     x *= scale.x; y *= scale.y; z *= scale.z; w *= scale.w;
 }
Ejemplo n.º 6
0
 // Multiplies two vectors component-wise.
 public static Vector4Int Scale(Vector4Int a, Vector4Int b)
 {
     return(new Vector4Int(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w));
 }