/// <summary> /// Initialization from Vector4i instance. /// </summary> public Vector3i(Vector4i v) { x = v.x; y = v.y; z = v.z; }
/// <summary> /// Return clamped version of specified vector with min/max range. /// </summary> /// <param name="value">Source vector.</param> /// <param name="min">Min value.</param> /// <param name="max">Max value.</param> public static Vector4i Clamp(Vector4i value, Vector4i min, Vector4i max) { return(new Vector4i(Mathf.Clamp(value.x, min.x, max.x), Mathf.Clamp(value.y, min.y, max.y), Mathf.Clamp(value.z, min.z, max.z), Mathf.Clamp(value.w, min.w, max.w))); }
/// <summary> /// Initialization from Vector4i instance. /// </summary> public Vector2i(Vector4i v) { x = v.x; y = v.y; }
/// <summary> /// Combine new Vector4i from min values of two vectors. /// </summary> /// <param name="lhs">First vector.</param> /// <param name="rhs">Second vector.</param> public static Vector4i Min(Vector4i lhs, Vector4i rhs) { return(new Vector4i(lhs.x < rhs.x ? lhs.x : rhs.x, lhs.x < rhs.x ? lhs.y : rhs.y, lhs.z < rhs.z ? lhs.z : rhs.z, lhs.w < rhs.w ? lhs.w : rhs.w)); }
/// <summary> /// Combine new Vector4i from max values of two vectors. /// </summary> /// <param name="lhs">First vector.</param> /// <param name="rhs">Second vector.</param> public static Vector4i Max(Vector4i lhs, Vector4i rhs) { return(new Vector4i(lhs.x > rhs.x ? lhs.x : rhs.x, lhs.x > rhs.x ? lhs.y : rhs.y, lhs.z > rhs.z ? lhs.z : rhs.z, lhs.w > rhs.w ? lhs.w : rhs.w)); }
/// <summary> /// Combine new Vector4i from min values of two vectors. /// </summary> /// <param name="lhs">First vector.</param> /// <param name="rhs">Second vector.</param> public static Vector4i Min(Vector4i lhs, Vector4i rhs) { return new Vector4i (lhs.x < rhs.x ? lhs.x : rhs.x, lhs.x < rhs.x ? lhs.y : rhs.y, lhs.z < rhs.z ? lhs.z : rhs.z, lhs.w < rhs.w ? lhs.w : rhs.w); }
/// <summary> /// Combine new Vector4i from max values of two vectors. /// </summary> /// <param name="lhs">First vector.</param> /// <param name="rhs">Second vector.</param> public static Vector4i Max(Vector4i lhs, Vector4i rhs) { return new Vector4i (lhs.x > rhs.x ? lhs.x : rhs.x, lhs.x > rhs.x ? lhs.y : rhs.y, lhs.z > rhs.z ? lhs.z : rhs.z, lhs.w > rhs.w ? lhs.w : rhs.w); }
/// <summary> /// Return clamped version of specified vector with min/max range. /// </summary> /// <param name="value">Source vector.</param> /// <param name="min">Min value.</param> /// <param name="max">Max value.</param> public static Vector4i Clamp(Vector4i value, Vector4i min, Vector4i max) { return new Vector4i (Mathf.Clamp (value.x, min.x, max.x), Mathf.Clamp (value.y, min.y, max.y), Mathf.Clamp (value.z, min.z, max.z), Mathf.Clamp (value.w, min.w, max.w)); }