public override bool Equals(object other) { if (!(other is Vector4Int)) { return(false); } Vector4Int rhs = (Vector4Int)other; return(this == rhs); }
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); }
// 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))); }
// Returns the distance between /a/ and /b/. public static float Distance(Vector4Int a, Vector4Int b) { return((a - b).magnitude); }
// 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; }
// 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)); }