// Copyright (c) Xenko contributors (https://xenko.com) and Silicon Studio Corp. (https://www.siliconstudio.co.jp) // Distributed under the MIT license. See the LICENSE.md file in the project root for more information. namespace math { /// /// Extensions methods of the vector classes. /// public static class VectorExtensions { /// /// Return the Y/X components of the vector in the inverse order. /// /// the input vector public static Vec2 YX(this Vec2 vector) { return new Vec2(vector.Y, vector.X); } /// /// Return the X/Y components of the vector. /// /// the input vector public static Vec2 XY(this Vector3 vector) { return new Vec2(vector.X, vector.Y); } /// /// Return the X/Z components of the vector. /// /// the input vector public static Vec2 XZ(this Vector3 vector) { return new Vec2(vector.X, vector.Z); } /// /// Return the Y/Z components of the vector. /// /// the input vector public static Vec2 YZ(this Vector3 vector) { return new Vec2(vector.Y, vector.Z); } /// /// Return the X/Y components of the vector. /// /// the input vector public static Vec2 XY(this Vector4 vector) { return new Vec2(vector.X, vector.Y); } /// /// Return the X/Y/Z components of the vector. /// /// the input vector public static Vector3 XYZ(this Vector4 vector) { return new Vector3(vector.X, vector.Y, vector.Z); } } }