#if !UNITY_DOTSPLAYER using UnityEngine; #pragma warning disable 0660, 0661 namespace Unity.Mathematics { public partial struct float2 { /// /// Converts a float2 to Vector2. /// /// float2 to convert. /// The converted Vector2. public static implicit operator Vector2(float2 v) { return new Vector2(v.x, v.y); } /// /// Converts a Vector2 to float2. /// /// Vector2 to convert. /// The converted float2. public static implicit operator float2(Vector2 v) { return new float2(v.x, v.y); } } public partial struct float3 { /// /// Converts a float3 to Vector3. /// /// float3 to convert. /// The converted Vector3. public static implicit operator Vector3(float3 v) { return new Vector3(v.x, v.y, v.z); } /// /// Converts a Vector3 to float3. /// /// Vector3 to convert. /// The converted float3. public static implicit operator float3(Vector3 v) { return new float3(v.x, v.y, v.z); } } public partial struct float4 { /// /// Converts a Vector4 to float4. /// /// Vector4 to convert. /// The converted float4. public static implicit operator float4(Vector4 v) { return new float4(v.x, v.y, v.z, v.w); } /// /// Converts a float4 to Vector4. /// /// float4 to convert. /// The converted Vector4. public static implicit operator Vector4(float4 v) { return new Vector4(v.x, v.y, v.z, v.w); } } public partial struct quaternion { /// /// Converts a quaternion to Quaternion. /// /// quaternion to convert. /// The converted Quaternion. public static implicit operator Quaternion(quaternion q) { return new Quaternion(q.value.x, q.value.y, q.value.z, q.value.w); } /// /// Converts a Quaternion to quaternion. /// /// Quaternion to convert. /// The converted quaternion. public static implicit operator quaternion(Quaternion q) { return new quaternion(q.x, q.y, q.z, q.w); } } public partial struct float4x4 { /// /// Converts a Matrix4x4 to float4x4. /// /// Matrix4x4 to convert. /// The converted float4x4. public static implicit operator float4x4(Matrix4x4 m) { return new float4x4(m.GetColumn(0), m.GetColumn(1), m.GetColumn(2), m.GetColumn(3)); } /// /// Converts a float4x4 to Matrix4x4. /// /// float4x4 to convert. /// The converted Matrix4x4. public static implicit operator Matrix4x4(float4x4 m) { return new Matrix4x4(m.c0, m.c1, m.c2, m.c3); } } } #endif