bool3x4.gen.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. //
  5. // Changes to this file may cause incorrect behavior and will be lost if
  6. // the code is regenerated.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. using System;
  10. using System.Runtime.CompilerServices;
  11. #pragma warning disable 0660, 0661
  12. namespace Unity.Mathematics
  13. {
  14. [System.Serializable]
  15. public partial struct bool3x4 : System.IEquatable<bool3x4>
  16. {
  17. public bool3 c0;
  18. public bool3 c1;
  19. public bool3 c2;
  20. public bool3 c3;
  21. /// <summary>Constructs a bool3x4 matrix from four bool3 vectors.</summary>
  22. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  23. public bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3)
  24. {
  25. this.c0 = c0;
  26. this.c1 = c1;
  27. this.c2 = c2;
  28. this.c3 = c3;
  29. }
  30. /// <summary>Constructs a bool3x4 matrix from 12 bool values given in row-major order.</summary>
  31. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  32. public bool3x4(bool m00, bool m01, bool m02, bool m03,
  33. bool m10, bool m11, bool m12, bool m13,
  34. bool m20, bool m21, bool m22, bool m23)
  35. {
  36. this.c0 = new bool3(m00, m10, m20);
  37. this.c1 = new bool3(m01, m11, m21);
  38. this.c2 = new bool3(m02, m12, m22);
  39. this.c3 = new bool3(m03, m13, m23);
  40. }
  41. /// <summary>Constructs a bool3x4 matrix from a single bool value by assigning it to every component.</summary>
  42. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  43. public bool3x4(bool v)
  44. {
  45. this.c0 = v;
  46. this.c1 = v;
  47. this.c2 = v;
  48. this.c3 = v;
  49. }
  50. /// <summary>Implicitly converts a single bool value to a bool3x4 matrix by assigning it to every component.</summary>
  51. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  52. public static implicit operator bool3x4(bool v) { return new bool3x4(v); }
  53. /// <summary>Returns the result of a componentwise equality operation on two bool3x4 matrices.</summary>
  54. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  55. public static bool3x4 operator == (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
  56. /// <summary>Returns the result of a componentwise equality operation on a bool3x4 matrix and a bool value.</summary>
  57. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  58. public static bool3x4 operator == (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
  59. /// <summary>Returns the result of a componentwise equality operation on a bool value and a bool3x4 matrix.</summary>
  60. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  61. public static bool3x4 operator == (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
  62. /// <summary>Returns the result of a componentwise not equal operation on two bool3x4 matrices.</summary>
  63. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  64. public static bool3x4 operator != (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
  65. /// <summary>Returns the result of a componentwise not equal operation on a bool3x4 matrix and a bool value.</summary>
  66. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  67. public static bool3x4 operator != (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
  68. /// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool3x4 matrix.</summary>
  69. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  70. public static bool3x4 operator != (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
  71. /// <summary>Returns the result of a componentwise not operation on a bool3x4 matrix.</summary>
  72. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  73. public static bool3x4 operator ! (bool3x4 val) { return new bool3x4 (!val.c0, !val.c1, !val.c2, !val.c3); }
  74. /// <summary>Returns the result of a componentwise bitwise and operation on two bool3x4 matrices.</summary>
  75. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  76. public static bool3x4 operator & (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
  77. /// <summary>Returns the result of a componentwise bitwise and operation on a bool3x4 matrix and a bool value.</summary>
  78. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  79. public static bool3x4 operator & (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
  80. /// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool3x4 matrix.</summary>
  81. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  82. public static bool3x4 operator & (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
  83. /// <summary>Returns the result of a componentwise bitwise or operation on two bool3x4 matrices.</summary>
  84. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  85. public static bool3x4 operator | (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
  86. /// <summary>Returns the result of a componentwise bitwise or operation on a bool3x4 matrix and a bool value.</summary>
  87. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  88. public static bool3x4 operator | (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
  89. /// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool3x4 matrix.</summary>
  90. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  91. public static bool3x4 operator | (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
  92. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool3x4 matrices.</summary>
  93. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  94. public static bool3x4 operator ^ (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
  95. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool3x4 matrix and a bool value.</summary>
  96. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  97. public static bool3x4 operator ^ (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
  98. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x4 matrix.</summary>
  99. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  100. public static bool3x4 operator ^ (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
  101. /// <summary>Returns the bool3 element at a specified index.</summary>
  102. unsafe public ref bool3 this[int index]
  103. {
  104. get
  105. {
  106. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  107. if ((uint)index >= 4)
  108. throw new System.ArgumentException("index must be between[0...3]");
  109. #endif
  110. fixed (bool3x4* array = &this) { return ref ((bool3*)array)[index]; }
  111. }
  112. }
  113. /// <summary>Returns true if the bool3x4 is equal to a given bool3x4, false otherwise.</summary>
  114. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  115. public bool Equals(bool3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
  116. /// <summary>Returns true if the bool3x4 is equal to a given bool3x4, false otherwise.</summary>
  117. public override bool Equals(object o) { return Equals((bool3x4)o); }
  118. /// <summary>Returns a hash code for the bool3x4.</summary>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public override int GetHashCode() { return (int)math.hash(this); }
  121. /// <summary>Returns a string representation of the bool3x4.</summary>
  122. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  123. public override string ToString()
  124. {
  125. return string.Format("bool3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
  126. }
  127. }
  128. public static partial class math
  129. {
  130. /// <summary>Returns a bool3x4 matrix constructed from four bool3 vectors.</summary>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static bool3x4 bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3) { return new bool3x4(c0, c1, c2, c3); }
  133. /// <summary>Returns a bool3x4 matrix constructed from from 12 bool values given in row-major order.</summary>
  134. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  135. public static bool3x4 bool3x4(bool m00, bool m01, bool m02, bool m03,
  136. bool m10, bool m11, bool m12, bool m13,
  137. bool m20, bool m21, bool m22, bool m23)
  138. {
  139. return new bool3x4(m00, m01, m02, m03,
  140. m10, m11, m12, m13,
  141. m20, m21, m22, m23);
  142. }
  143. /// <summary>Returns a bool3x4 matrix constructed from a single bool value by assigning it to every component.</summary>
  144. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  145. public static bool3x4 bool3x4(bool v) { return new bool3x4(v); }
  146. /// <summary>Return the bool4x3 transpose of a bool3x4 matrix.</summary>
  147. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  148. public static bool4x3 transpose(bool3x4 v)
  149. {
  150. return bool4x3(
  151. v.c0.x, v.c0.y, v.c0.z,
  152. v.c1.x, v.c1.y, v.c1.z,
  153. v.c2.x, v.c2.y, v.c2.z,
  154. v.c3.x, v.c3.y, v.c3.z);
  155. }
  156. /// <summary>Returns a uint hash code of a bool3x4 vector.</summary>
  157. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  158. public static uint hash(bool3x4 v)
  159. {
  160. return csum(select(uint3(0x83B58237u, 0x833E3E29u, 0xA9D919BFu), uint3(0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u), v.c0) +
  161. select(uint3(0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu), uint3(0xC3D32AE1u, 0xB966942Fu, 0xFE9856B3u), v.c1) +
  162. select(uint3(0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u), uint3(0x94DDD769u, 0xA1E92D39u, 0x4583C801u), v.c2) +
  163. select(uint3(0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du), uint3(0xE3600729u, 0x5F17300Du, 0x670D6809u), v.c3));
  164. }
  165. /// <summary>
  166. /// Returns a uint3 vector hash code of a bool3x4 vector.
  167. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  168. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  169. /// </summary>
  170. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  171. public static uint3 hashwide(bool3x4 v)
  172. {
  173. return (select(uint3(0x7AF32C49u, 0xAE131389u, 0x5D1B165Bu), uint3(0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u), v.c0) +
  174. select(uint3(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du), uint3(0x614DA60Du, 0x5BA2C50Bu, 0x8C455ACBu), v.c1) +
  175. select(uint3(0xCD266C89u, 0xF1852A33u, 0x77E35E77u), uint3(0x863E3729u, 0xE191B035u, 0x68586FAFu), v.c2) +
  176. select(uint3(0xD4DFF6D3u, 0xCB634F4Du, 0x9B13B92Du), uint3(0x4ABF0813u, 0x86068063u, 0xD75513F9u), v.c3));
  177. }
  178. }
  179. }