/// <summary> /// Flips the V component of all TexCoords in an array to convert between glTF and Unity's TexCoord specification. /// </summary> /// <param name="array">The array of TexCoords to be converted.</param> /// <returns>The array of converted TexCoords.</returns> public static GLTF.Math.Vector2[] FlipTexCoordArrayV(GLTF.Math.Vector2[] array) { var returnArray = new GLTF.Math.Vector2[array.Length]; for (var i = 0; i < array.Length; i++) { returnArray[i] = FlipTexCoordV(array[i]); } return(returnArray); }
public static Vector2 ToUnityVector2(this GLTF.Math.Vector2 vec3) { return(new Vector2(vec3.X, vec3.Y)); }
/// <summary> /// Flips the V component of a TexCoord to convert between glTF and Unity's TexCoord specification. /// </summary> /// <param name="vector">The TexCoord to be converted.</param> /// <returns>The converted TexCoord.</returns> public static GLTF.Math.Vector2 FlipTexCoordV(GLTF.Math.Vector2 vector) { return(new GLTF.Math.Vector2(vector.X, 1.0f - vector.Y)); }
public static Vector2 ToUnityVector2Raw(this GLTF.Math.Vector2 vec2) { return(new Vector2(vec2.X, vec2.Y)); }