matrix_integer.hpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. /// THE SOFTWARE.
  22. ///
  23. /// @ref gtc_matrix_integer
  24. /// @file glm/gtc/matrix_integer.hpp
  25. /// @date 2011-01-20 / 2011-06-05
  26. /// @author Christophe Riccio
  27. ///
  28. /// @see core (dependence)
  29. ///
  30. /// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer
  31. /// @ingroup gtc
  32. ///
  33. /// Defines a number of matrices with integer types.
  34. /// <glm/gtc/matrix_integer.hpp> need to be included to use these functionalities.
  35. ///////////////////////////////////////////////////////////////////////////////////
  36. #pragma once
  37. // Dependency:
  38. #include "../mat2x2.hpp"
  39. #include "../mat2x3.hpp"
  40. #include "../mat2x4.hpp"
  41. #include "../mat3x2.hpp"
  42. #include "../mat3x3.hpp"
  43. #include "../mat3x4.hpp"
  44. #include "../mat4x2.hpp"
  45. #include "../mat4x3.hpp"
  46. #include "../mat4x4.hpp"
  47. #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
  48. # pragma message("GLM: GLM_GTC_matrix_integer extension included")
  49. #endif
  50. namespace glm
  51. {
  52. /// @addtogroup gtc_matrix_integer
  53. /// @{
  54. /// High-precision signed integer 2x2 matrix.
  55. /// @see gtc_matrix_integer
  56. typedef detail::tmat2x2<int, highp> highp_imat2;
  57. /// High-precision signed integer 3x3 matrix.
  58. /// @see gtc_matrix_integer
  59. typedef detail::tmat3x3<int, highp> highp_imat3;
  60. /// High-precision signed integer 4x4 matrix.
  61. /// @see gtc_matrix_integer
  62. typedef detail::tmat4x4<int, highp> highp_imat4;
  63. /// High-precision signed integer 2x2 matrix.
  64. /// @see gtc_matrix_integer
  65. typedef detail::tmat2x2<int, highp> highp_imat2x2;
  66. /// High-precision signed integer 2x3 matrix.
  67. /// @see gtc_matrix_integer
  68. typedef detail::tmat2x3<int, highp> highp_imat2x3;
  69. /// High-precision signed integer 2x4 matrix.
  70. /// @see gtc_matrix_integer
  71. typedef detail::tmat2x4<int, highp> highp_imat2x4;
  72. /// High-precision signed integer 3x2 matrix.
  73. /// @see gtc_matrix_integer
  74. typedef detail::tmat3x2<int, highp> highp_imat3x2;
  75. /// High-precision signed integer 3x3 matrix.
  76. /// @see gtc_matrix_integer
  77. typedef detail::tmat3x3<int, highp> highp_imat3x3;
  78. /// High-precision signed integer 3x4 matrix.
  79. /// @see gtc_matrix_integer
  80. typedef detail::tmat3x4<int, highp> highp_imat3x4;
  81. /// High-precision signed integer 4x2 matrix.
  82. /// @see gtc_matrix_integer
  83. typedef detail::tmat4x2<int, highp> highp_imat4x2;
  84. /// High-precision signed integer 4x3 matrix.
  85. /// @see gtc_matrix_integer
  86. typedef detail::tmat4x3<int, highp> highp_imat4x3;
  87. /// High-precision signed integer 4x4 matrix.
  88. /// @see gtc_matrix_integer
  89. typedef detail::tmat4x4<int, highp> highp_imat4x4;
  90. /// Medium-precision signed integer 2x2 matrix.
  91. /// @see gtc_matrix_integer
  92. typedef detail::tmat2x2<int, mediump> mediump_imat2;
  93. /// Medium-precision signed integer 3x3 matrix.
  94. /// @see gtc_matrix_integer
  95. typedef detail::tmat3x3<int, mediump> mediump_imat3;
  96. /// Medium-precision signed integer 4x4 matrix.
  97. /// @see gtc_matrix_integer
  98. typedef detail::tmat4x4<int, mediump> mediump_imat4;
  99. /// Medium-precision signed integer 2x2 matrix.
  100. /// @see gtc_matrix_integer
  101. typedef detail::tmat2x2<int, mediump> mediump_imat2x2;
  102. /// Medium-precision signed integer 2x3 matrix.
  103. /// @see gtc_matrix_integer
  104. typedef detail::tmat2x3<int, mediump> mediump_imat2x3;
  105. /// Medium-precision signed integer 2x4 matrix.
  106. /// @see gtc_matrix_integer
  107. typedef detail::tmat2x4<int, mediump> mediump_imat2x4;
  108. /// Medium-precision signed integer 3x2 matrix.
  109. /// @see gtc_matrix_integer
  110. typedef detail::tmat3x2<int, mediump> mediump_imat3x2;
  111. /// Medium-precision signed integer 3x3 matrix.
  112. /// @see gtc_matrix_integer
  113. typedef detail::tmat3x3<int, mediump> mediump_imat3x3;
  114. /// Medium-precision signed integer 3x4 matrix.
  115. /// @see gtc_matrix_integer
  116. typedef detail::tmat3x4<int, mediump> mediump_imat3x4;
  117. /// Medium-precision signed integer 4x2 matrix.
  118. /// @see gtc_matrix_integer
  119. typedef detail::tmat4x2<int, mediump> mediump_imat4x2;
  120. /// Medium-precision signed integer 4x3 matrix.
  121. /// @see gtc_matrix_integer
  122. typedef detail::tmat4x3<int, mediump> mediump_imat4x3;
  123. /// Medium-precision signed integer 4x4 matrix.
  124. /// @see gtc_matrix_integer
  125. typedef detail::tmat4x4<int, mediump> mediump_imat4x4;
  126. /// Low-precision signed integer 2x2 matrix.
  127. /// @see gtc_matrix_integer
  128. typedef detail::tmat2x2<int, lowp> lowp_imat2;
  129. /// Low-precision signed integer 3x3 matrix.
  130. /// @see gtc_matrix_integer
  131. typedef detail::tmat3x3<int, lowp> lowp_imat3;
  132. /// Low-precision signed integer 4x4 matrix.
  133. /// @see gtc_matrix_integer
  134. typedef detail::tmat4x4<int, lowp> lowp_imat4;
  135. /// Low-precision signed integer 2x2 matrix.
  136. /// @see gtc_matrix_integer
  137. typedef detail::tmat2x2<int, lowp> lowp_imat2x2;
  138. /// Low-precision signed integer 2x3 matrix.
  139. /// @see gtc_matrix_integer
  140. typedef detail::tmat2x3<int, lowp> lowp_imat2x3;
  141. /// Low-precision signed integer 2x4 matrix.
  142. /// @see gtc_matrix_integer
  143. typedef detail::tmat2x4<int, lowp> lowp_imat2x4;
  144. /// Low-precision signed integer 3x2 matrix.
  145. /// @see gtc_matrix_integer
  146. typedef detail::tmat3x2<int, lowp> lowp_imat3x2;
  147. /// Low-precision signed integer 3x3 matrix.
  148. /// @see gtc_matrix_integer
  149. typedef detail::tmat3x3<int, lowp> lowp_imat3x3;
  150. /// Low-precision signed integer 3x4 matrix.
  151. /// @see gtc_matrix_integer
  152. typedef detail::tmat3x4<int, lowp> lowp_imat3x4;
  153. /// Low-precision signed integer 4x2 matrix.
  154. /// @see gtc_matrix_integer
  155. typedef detail::tmat4x2<int, lowp> lowp_imat4x2;
  156. /// Low-precision signed integer 4x3 matrix.
  157. /// @see gtc_matrix_integer
  158. typedef detail::tmat4x3<int, lowp> lowp_imat4x3;
  159. /// Low-precision signed integer 4x4 matrix.
  160. /// @see gtc_matrix_integer
  161. typedef detail::tmat4x4<int, lowp> lowp_imat4x4;
  162. /// High-precision unsigned integer 2x2 matrix.
  163. /// @see gtc_matrix_integer
  164. typedef detail::tmat2x2<uint, highp> highp_umat2;
  165. /// High-precision unsigned integer 3x3 matrix.
  166. /// @see gtc_matrix_integer
  167. typedef detail::tmat3x3<uint, highp> highp_umat3;
  168. /// High-precision unsigned integer 4x4 matrix.
  169. /// @see gtc_matrix_integer
  170. typedef detail::tmat4x4<uint, highp> highp_umat4;
  171. /// High-precision unsigned integer 2x2 matrix.
  172. /// @see gtc_matrix_integer
  173. typedef detail::tmat2x2<uint, highp> highp_umat2x2;
  174. /// High-precision unsigned integer 2x3 matrix.
  175. /// @see gtc_matrix_integer
  176. typedef detail::tmat2x3<uint, highp> highp_umat2x3;
  177. /// High-precision unsigned integer 2x4 matrix.
  178. /// @see gtc_matrix_integer
  179. typedef detail::tmat2x4<uint, highp> highp_umat2x4;
  180. /// High-precision unsigned integer 3x2 matrix.
  181. /// @see gtc_matrix_integer
  182. typedef detail::tmat3x2<uint, highp> highp_umat3x2;
  183. /// High-precision unsigned integer 3x3 matrix.
  184. /// @see gtc_matrix_integer
  185. typedef detail::tmat3x3<uint, highp> highp_umat3x3;
  186. /// High-precision unsigned integer 3x4 matrix.
  187. /// @see gtc_matrix_integer
  188. typedef detail::tmat3x4<uint, highp> highp_umat3x4;
  189. /// High-precision unsigned integer 4x2 matrix.
  190. /// @see gtc_matrix_integer
  191. typedef detail::tmat4x2<uint, highp> highp_umat4x2;
  192. /// High-precision unsigned integer 4x3 matrix.
  193. /// @see gtc_matrix_integer
  194. typedef detail::tmat4x3<uint, highp> highp_umat4x3;
  195. /// High-precision unsigned integer 4x4 matrix.
  196. /// @see gtc_matrix_integer
  197. typedef detail::tmat4x4<uint, highp> highp_umat4x4;
  198. /// Medium-precision unsigned integer 2x2 matrix.
  199. /// @see gtc_matrix_integer
  200. typedef detail::tmat2x2<uint, mediump> mediump_umat2;
  201. /// Medium-precision unsigned integer 3x3 matrix.
  202. /// @see gtc_matrix_integer
  203. typedef detail::tmat3x3<uint, mediump> mediump_umat3;
  204. /// Medium-precision unsigned integer 4x4 matrix.
  205. /// @see gtc_matrix_integer
  206. typedef detail::tmat4x4<uint, mediump> mediump_umat4;
  207. /// Medium-precision unsigned integer 2x2 matrix.
  208. /// @see gtc_matrix_integer
  209. typedef detail::tmat2x2<uint, mediump> mediump_umat2x2;
  210. /// Medium-precision unsigned integer 2x3 matrix.
  211. /// @see gtc_matrix_integer
  212. typedef detail::tmat2x3<uint, mediump> mediump_umat2x3;
  213. /// Medium-precision unsigned integer 2x4 matrix.
  214. /// @see gtc_matrix_integer
  215. typedef detail::tmat2x4<uint, mediump> mediump_umat2x4;
  216. /// Medium-precision unsigned integer 3x2 matrix.
  217. /// @see gtc_matrix_integer
  218. typedef detail::tmat3x2<uint, mediump> mediump_umat3x2;
  219. /// Medium-precision unsigned integer 3x3 matrix.
  220. /// @see gtc_matrix_integer
  221. typedef detail::tmat3x3<uint, mediump> mediump_umat3x3;
  222. /// Medium-precision unsigned integer 3x4 matrix.
  223. /// @see gtc_matrix_integer
  224. typedef detail::tmat3x4<uint, mediump> mediump_umat3x4;
  225. /// Medium-precision unsigned integer 4x2 matrix.
  226. /// @see gtc_matrix_integer
  227. typedef detail::tmat4x2<uint, mediump> mediump_umat4x2;
  228. /// Medium-precision unsigned integer 4x3 matrix.
  229. /// @see gtc_matrix_integer
  230. typedef detail::tmat4x3<uint, mediump> mediump_umat4x3;
  231. /// Medium-precision unsigned integer 4x4 matrix.
  232. /// @see gtc_matrix_integer
  233. typedef detail::tmat4x4<uint, mediump> mediump_umat4x4;
  234. /// Low-precision unsigned integer 2x2 matrix.
  235. /// @see gtc_matrix_integer
  236. typedef detail::tmat2x2<uint, lowp> lowp_umat2;
  237. /// Low-precision unsigned integer 3x3 matrix.
  238. /// @see gtc_matrix_integer
  239. typedef detail::tmat3x3<uint, lowp> lowp_umat3;
  240. /// Low-precision unsigned integer 4x4 matrix.
  241. /// @see gtc_matrix_integer
  242. typedef detail::tmat4x4<uint, lowp> lowp_umat4;
  243. /// Low-precision unsigned integer 2x2 matrix.
  244. /// @see gtc_matrix_integer
  245. typedef detail::tmat2x2<uint, lowp> lowp_umat2x2;
  246. /// Low-precision unsigned integer 2x3 matrix.
  247. /// @see gtc_matrix_integer
  248. typedef detail::tmat2x3<uint, lowp> lowp_umat2x3;
  249. /// Low-precision unsigned integer 2x4 matrix.
  250. /// @see gtc_matrix_integer
  251. typedef detail::tmat2x4<uint, lowp> lowp_umat2x4;
  252. /// Low-precision unsigned integer 3x2 matrix.
  253. /// @see gtc_matrix_integer
  254. typedef detail::tmat3x2<uint, lowp> lowp_umat3x2;
  255. /// Low-precision unsigned integer 3x3 matrix.
  256. /// @see gtc_matrix_integer
  257. typedef detail::tmat3x3<uint, lowp> lowp_umat3x3;
  258. /// Low-precision unsigned integer 3x4 matrix.
  259. /// @see gtc_matrix_integer
  260. typedef detail::tmat3x4<uint, lowp> lowp_umat3x4;
  261. /// Low-precision unsigned integer 4x2 matrix.
  262. /// @see gtc_matrix_integer
  263. typedef detail::tmat4x2<uint, lowp> lowp_umat4x2;
  264. /// Low-precision unsigned integer 4x3 matrix.
  265. /// @see gtc_matrix_integer
  266. typedef detail::tmat4x3<uint, lowp> lowp_umat4x3;
  267. /// Low-precision unsigned integer 4x4 matrix.
  268. /// @see gtc_matrix_integer
  269. typedef detail::tmat4x4<uint, lowp> lowp_umat4x4;
  270. #if(defined(GLM_PRECISION_HIGHP_INT))
  271. typedef highp_imat2 imat2;
  272. typedef highp_imat3 imat3;
  273. typedef highp_imat4 imat4;
  274. typedef highp_imat2x2 imat2x2;
  275. typedef highp_imat2x3 imat2x3;
  276. typedef highp_imat2x4 imat2x4;
  277. typedef highp_imat3x2 imat3x2;
  278. typedef highp_imat3x3 imat3x3;
  279. typedef highp_imat3x4 imat3x4;
  280. typedef highp_imat4x2 imat4x2;
  281. typedef highp_imat4x3 imat4x3;
  282. typedef highp_imat4x4 imat4x4;
  283. #elif(defined(GLM_PRECISION_LOWP_INT))
  284. typedef lowp_imat2 imat2;
  285. typedef lowp_imat3 imat3;
  286. typedef lowp_imat4 imat4;
  287. typedef lowp_imat2x2 imat2x2;
  288. typedef lowp_imat2x3 imat2x3;
  289. typedef lowp_imat2x4 imat2x4;
  290. typedef lowp_imat3x2 imat3x2;
  291. typedef lowp_imat3x3 imat3x3;
  292. typedef lowp_imat3x4 imat3x4;
  293. typedef lowp_imat4x2 imat4x2;
  294. typedef lowp_imat4x3 imat4x3;
  295. typedef lowp_imat4x4 imat4x4;
  296. #else //if(defined(GLM_PRECISION_MEDIUMP_INT))
  297. /// Signed integer 2x2 matrix.
  298. /// @see gtc_matrix_integer
  299. typedef mediump_imat2 imat2;
  300. /// Signed integer 3x3 matrix.
  301. /// @see gtc_matrix_integer
  302. typedef mediump_imat3 imat3;
  303. /// Signed integer 4x4 matrix.
  304. /// @see gtc_matrix_integer
  305. typedef mediump_imat4 imat4;
  306. /// Signed integer 2x2 matrix.
  307. /// @see gtc_matrix_integer
  308. typedef mediump_imat2x2 imat2x2;
  309. /// Signed integer 2x3 matrix.
  310. /// @see gtc_matrix_integer
  311. typedef mediump_imat2x3 imat2x3;
  312. /// Signed integer 2x4 matrix.
  313. /// @see gtc_matrix_integer
  314. typedef mediump_imat2x4 imat2x4;
  315. /// Signed integer 3x2 matrix.
  316. /// @see gtc_matrix_integer
  317. typedef mediump_imat3x2 imat3x2;
  318. /// Signed integer 3x3 matrix.
  319. /// @see gtc_matrix_integer
  320. typedef mediump_imat3x3 imat3x3;
  321. /// Signed integer 3x4 matrix.
  322. /// @see gtc_matrix_integer
  323. typedef mediump_imat3x4 imat3x4;
  324. /// Signed integer 4x2 matrix.
  325. /// @see gtc_matrix_integer
  326. typedef mediump_imat4x2 imat4x2;
  327. /// Signed integer 4x3 matrix.
  328. /// @see gtc_matrix_integer
  329. typedef mediump_imat4x3 imat4x3;
  330. /// Signed integer 4x4 matrix.
  331. /// @see gtc_matrix_integer
  332. typedef mediump_imat4x4 imat4x4;
  333. #endif//GLM_PRECISION
  334. #if(defined(GLM_PRECISION_HIGHP_UINT))
  335. typedef highp_umat2 umat2;
  336. typedef highp_umat3 umat3;
  337. typedef highp_umat4 umat4;
  338. typedef highp_umat2x2 umat2x2;
  339. typedef highp_umat2x3 umat2x3;
  340. typedef highp_umat2x4 umat2x4;
  341. typedef highp_umat3x2 umat3x2;
  342. typedef highp_umat3x3 umat3x3;
  343. typedef highp_umat3x4 umat3x4;
  344. typedef highp_umat4x2 umat4x2;
  345. typedef highp_umat4x3 umat4x3;
  346. typedef highp_umat4x4 umat4x4;
  347. #elif(defined(GLM_PRECISION_LOWP_UINT))
  348. typedef lowp_umat2 umat2;
  349. typedef lowp_umat3 umat3;
  350. typedef lowp_umat4 umat4;
  351. typedef lowp_umat2x2 umat2x2;
  352. typedef lowp_umat2x3 umat2x3;
  353. typedef lowp_umat2x4 umat2x4;
  354. typedef lowp_umat3x2 umat3x2;
  355. typedef lowp_umat3x3 umat3x3;
  356. typedef lowp_umat3x4 umat3x4;
  357. typedef lowp_umat4x2 umat4x2;
  358. typedef lowp_umat4x3 umat4x3;
  359. typedef lowp_umat4x4 umat4x4;
  360. #else //if(defined(GLM_PRECISION_MEDIUMP_UINT))
  361. /// Unsigned integer 2x2 matrix.
  362. /// @see gtc_matrix_integer
  363. typedef mediump_umat2 umat2;
  364. /// Unsigned integer 3x3 matrix.
  365. /// @see gtc_matrix_integer
  366. typedef mediump_umat3 umat3;
  367. /// Unsigned integer 4x4 matrix.
  368. /// @see gtc_matrix_integer
  369. typedef mediump_umat4 umat4;
  370. /// Unsigned integer 2x2 matrix.
  371. /// @see gtc_matrix_integer
  372. typedef mediump_umat2x2 umat2x2;
  373. /// Unsigned integer 2x3 matrix.
  374. /// @see gtc_matrix_integer
  375. typedef mediump_umat2x3 umat2x3;
  376. /// Unsigned integer 2x4 matrix.
  377. /// @see gtc_matrix_integer
  378. typedef mediump_umat2x4 umat2x4;
  379. /// Unsigned integer 3x2 matrix.
  380. /// @see gtc_matrix_integer
  381. typedef mediump_umat3x2 umat3x2;
  382. /// Unsigned integer 3x3 matrix.
  383. /// @see gtc_matrix_integer
  384. typedef mediump_umat3x3 umat3x3;
  385. /// Unsigned integer 3x4 matrix.
  386. /// @see gtc_matrix_integer
  387. typedef mediump_umat3x4 umat3x4;
  388. /// Unsigned integer 4x2 matrix.
  389. /// @see gtc_matrix_integer
  390. typedef mediump_umat4x2 umat4x2;
  391. /// Unsigned integer 4x3 matrix.
  392. /// @see gtc_matrix_integer
  393. typedef mediump_umat4x3 umat4x3;
  394. /// Unsigned integer 4x4 matrix.
  395. /// @see gtc_matrix_integer
  396. typedef mediump_umat4x4 umat4x4;
  397. #endif//GLM_PRECISION
  398. /// @}
  399. }//namespace glm