You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

506 lines
16 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2013 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. #ifndef GLM_GTC_matrix_integer
  37. #define GLM_GTC_matrix_integer GLM_VERSION
  38. // Dependency:
  39. #include "../glm.hpp"
  40. #if(defined(GLM_MESSAGES) && !defined(glm_ext))
  41. # pragma message("GLM: GLM_GTC_matrix_integer extension included")
  42. #endif
  43. namespace glm
  44. {
  45. /// @addtogroup gtc_matrix_integer
  46. /// @{
  47. /// High-precision signed integer 2x2 matrix.
  48. /// @see gtc_matrix_integer
  49. typedef detail::tmat2x2<highp_int> highp_imat2;
  50. /// High-precision signed integer 3x3 matrix.
  51. /// @see gtc_matrix_integer
  52. typedef detail::tmat3x3<highp_int> highp_imat3;
  53. /// High-precision signed integer 4x4 matrix.
  54. /// @see gtc_matrix_integer
  55. typedef detail::tmat4x4<highp_int> highp_imat4;
  56. /// High-precision signed integer 2x2 matrix.
  57. /// @see gtc_matrix_integer
  58. typedef detail::tmat2x2<highp_int> highp_imat2x2;
  59. /// High-precision signed integer 2x3 matrix.
  60. /// @see gtc_matrix_integer
  61. typedef detail::tmat2x3<highp_int> highp_imat2x3;
  62. /// High-precision signed integer 2x4 matrix.
  63. /// @see gtc_matrix_integer
  64. typedef detail::tmat2x4<highp_int> highp_imat2x4;
  65. /// High-precision signed integer 3x2 matrix.
  66. /// @see gtc_matrix_integer
  67. typedef detail::tmat3x2<highp_int> highp_imat3x2;
  68. /// High-precision signed integer 3x3 matrix.
  69. /// @see gtc_matrix_integer
  70. typedef detail::tmat3x3<highp_int> highp_imat3x3;
  71. /// High-precision signed integer 3x4 matrix.
  72. /// @see gtc_matrix_integer
  73. typedef detail::tmat3x4<highp_int> highp_imat3x4;
  74. /// High-precision signed integer 4x2 matrix.
  75. /// @see gtc_matrix_integer
  76. typedef detail::tmat4x2<highp_int> highp_imat4x2;
  77. /// High-precision signed integer 4x3 matrix.
  78. /// @see gtc_matrix_integer
  79. typedef detail::tmat4x3<highp_int> highp_imat4x3;
  80. /// High-precision signed integer 4x4 matrix.
  81. /// @see gtc_matrix_integer
  82. typedef detail::tmat4x4<highp_int> highp_imat4x4;
  83. /// Medium-precision signed integer 2x2 matrix.
  84. /// @see gtc_matrix_integer
  85. typedef detail::tmat2x2<mediump_int> mediump_imat2;
  86. /// Medium-precision signed integer 3x3 matrix.
  87. /// @see gtc_matrix_integer
  88. typedef detail::tmat3x3<mediump_int> mediump_imat3;
  89. /// Medium-precision signed integer 4x4 matrix.
  90. /// @see gtc_matrix_integer
  91. typedef detail::tmat4x4<mediump_int> mediump_imat4;
  92. /// Medium-precision signed integer 2x2 matrix.
  93. /// @see gtc_matrix_integer
  94. typedef detail::tmat2x2<mediump_int> mediump_imat2x2;
  95. /// Medium-precision signed integer 2x3 matrix.
  96. /// @see gtc_matrix_integer
  97. typedef detail::tmat2x3<mediump_int> mediump_imat2x3;
  98. /// Medium-precision signed integer 2x4 matrix.
  99. /// @see gtc_matrix_integer
  100. typedef detail::tmat2x4<mediump_int> mediump_imat2x4;
  101. /// Medium-precision signed integer 3x2 matrix.
  102. /// @see gtc_matrix_integer
  103. typedef detail::tmat3x2<mediump_int> mediump_imat3x2;
  104. /// Medium-precision signed integer 3x3 matrix.
  105. /// @see gtc_matrix_integer
  106. typedef detail::tmat3x3<mediump_int> mediump_imat3x3;
  107. /// Medium-precision signed integer 3x4 matrix.
  108. /// @see gtc_matrix_integer
  109. typedef detail::tmat3x4<mediump_int> mediump_imat3x4;
  110. /// Medium-precision signed integer 4x2 matrix.
  111. /// @see gtc_matrix_integer
  112. typedef detail::tmat4x2<mediump_int> mediump_imat4x2;
  113. /// Medium-precision signed integer 4x3 matrix.
  114. /// @see gtc_matrix_integer
  115. typedef detail::tmat4x3<mediump_int> mediump_imat4x3;
  116. /// Medium-precision signed integer 4x4 matrix.
  117. /// @see gtc_matrix_integer
  118. typedef detail::tmat4x4<mediump_int> mediump_imat4x4;
  119. /// Low-precision signed integer 2x2 matrix.
  120. /// @see gtc_matrix_integer
  121. typedef detail::tmat2x2<lowp_int> lowp_imat2;
  122. /// Low-precision signed integer 3x3 matrix.
  123. /// @see gtc_matrix_integer
  124. typedef detail::tmat3x3<lowp_int> lowp_imat3;
  125. /// Low-precision signed integer 4x4 matrix.
  126. /// @see gtc_matrix_integer
  127. typedef detail::tmat4x4<lowp_int> lowp_imat4;
  128. /// Low-precision signed integer 2x2 matrix.
  129. /// @see gtc_matrix_integer
  130. typedef detail::tmat2x2<lowp_int> lowp_imat2x2;
  131. /// Low-precision signed integer 2x3 matrix.
  132. /// @see gtc_matrix_integer
  133. typedef detail::tmat2x3<lowp_int> lowp_imat2x3;
  134. /// Low-precision signed integer 2x4 matrix.
  135. /// @see gtc_matrix_integer
  136. typedef detail::tmat2x4<lowp_int> lowp_imat2x4;
  137. /// Low-precision signed integer 3x2 matrix.
  138. /// @see gtc_matrix_integer
  139. typedef detail::tmat3x2<lowp_int> lowp_imat3x2;
  140. /// Low-precision signed integer 3x3 matrix.
  141. /// @see gtc_matrix_integer
  142. typedef detail::tmat3x3<lowp_int> lowp_imat3x3;
  143. /// Low-precision signed integer 3x4 matrix.
  144. /// @see gtc_matrix_integer
  145. typedef detail::tmat3x4<lowp_int> lowp_imat3x4;
  146. /// Low-precision signed integer 4x2 matrix.
  147. /// @see gtc_matrix_integer
  148. typedef detail::tmat4x2<lowp_int> lowp_imat4x2;
  149. /// Low-precision signed integer 4x3 matrix.
  150. /// @see gtc_matrix_integer
  151. typedef detail::tmat4x3<lowp_int> lowp_imat4x3;
  152. /// Low-precision signed integer 4x4 matrix.
  153. /// @see gtc_matrix_integer
  154. typedef detail::tmat4x4<lowp_int> lowp_imat4x4;
  155. /// High-precision unsigned integer 2x2 matrix.
  156. /// @see gtc_matrix_integer
  157. typedef detail::tmat2x2<highp_uint> highp_umat2;
  158. /// High-precision unsigned integer 3x3 matrix.
  159. /// @see gtc_matrix_integer
  160. typedef detail::tmat3x3<highp_uint> highp_umat3;
  161. /// High-precision unsigned integer 4x4 matrix.
  162. /// @see gtc_matrix_integer
  163. typedef detail::tmat4x4<highp_uint> highp_umat4;
  164. /// High-precision unsigned integer 2x2 matrix.
  165. /// @see gtc_matrix_integer
  166. typedef detail::tmat2x2<highp_uint> highp_umat2x2;
  167. /// High-precision unsigned integer 2x3 matrix.
  168. /// @see gtc_matrix_integer
  169. typedef detail::tmat2x3<highp_uint> highp_umat2x3;
  170. /// High-precision unsigned integer 2x4 matrix.
  171. /// @see gtc_matrix_integer
  172. typedef detail::tmat2x4<highp_uint> highp_umat2x4;
  173. /// High-precision unsigned integer 3x2 matrix.
  174. /// @see gtc_matrix_integer
  175. typedef detail::tmat3x2<highp_uint> highp_umat3x2;
  176. /// High-precision unsigned integer 3x3 matrix.
  177. /// @see gtc_matrix_integer
  178. typedef detail::tmat3x3<highp_uint> highp_umat3x3;
  179. /// High-precision unsigned integer 3x4 matrix.
  180. /// @see gtc_matrix_integer
  181. typedef detail::tmat3x4<highp_uint> highp_umat3x4;
  182. /// High-precision unsigned integer 4x2 matrix.
  183. /// @see gtc_matrix_integer
  184. typedef detail::tmat4x2<highp_uint> highp_umat4x2;
  185. /// High-precision unsigned integer 4x3 matrix.
  186. /// @see gtc_matrix_integer
  187. typedef detail::tmat4x3<highp_uint> highp_umat4x3;
  188. /// High-precision unsigned integer 4x4 matrix.
  189. /// @see gtc_matrix_integer
  190. typedef detail::tmat4x4<highp_uint> highp_umat4x4;
  191. /// Medium-precision unsigned integer 2x2 matrix.
  192. /// @see gtc_matrix_integer
  193. typedef detail::tmat2x2<mediump_uint> mediump_umat2;
  194. /// Medium-precision unsigned integer 3x3 matrix.
  195. /// @see gtc_matrix_integer
  196. typedef detail::tmat3x3<mediump_uint> mediump_umat3;
  197. /// Medium-precision unsigned integer 4x4 matrix.
  198. /// @see gtc_matrix_integer
  199. typedef detail::tmat4x4<mediump_uint> mediump_umat4;
  200. /// Medium-precision unsigned integer 2x2 matrix.
  201. /// @see gtc_matrix_integer
  202. typedef detail::tmat2x2<mediump_uint> mediump_umat2x2;
  203. /// Medium-precision unsigned integer 2x3 matrix.
  204. /// @see gtc_matrix_integer
  205. typedef detail::tmat2x3<mediump_uint> mediump_umat2x3;
  206. /// Medium-precision unsigned integer 2x4 matrix.
  207. /// @see gtc_matrix_integer
  208. typedef detail::tmat2x4<mediump_uint> mediump_umat2x4;
  209. /// Medium-precision unsigned integer 3x2 matrix.
  210. /// @see gtc_matrix_integer
  211. typedef detail::tmat3x2<mediump_uint> mediump_umat3x2;
  212. /// Medium-precision unsigned integer 3x3 matrix.
  213. /// @see gtc_matrix_integer
  214. typedef detail::tmat3x3<mediump_uint> mediump_umat3x3;
  215. /// Medium-precision unsigned integer 3x4 matrix.
  216. /// @see gtc_matrix_integer
  217. typedef detail::tmat3x4<mediump_uint> mediump_umat3x4;
  218. /// Medium-precision unsigned integer 4x2 matrix.
  219. /// @see gtc_matrix_integer
  220. typedef detail::tmat4x2<mediump_uint> mediump_umat4x2;
  221. /// Medium-precision unsigned integer 4x3 matrix.
  222. /// @see gtc_matrix_integer
  223. typedef detail::tmat4x3<mediump_uint> mediump_umat4x3;
  224. /// Medium-precision unsigned integer 4x4 matrix.
  225. /// @see gtc_matrix_integer
  226. typedef detail::tmat4x4<mediump_uint> mediump_umat4x4;
  227. /// Low-precision unsigned integer 2x2 matrix.
  228. /// @see gtc_matrix_integer
  229. typedef detail::tmat2x2<lowp_uint> lowp_umat2;
  230. /// Low-precision unsigned integer 3x3 matrix.
  231. /// @see gtc_matrix_integer
  232. typedef detail::tmat3x3<lowp_uint> lowp_umat3;
  233. /// Low-precision unsigned integer 4x4 matrix.
  234. /// @see gtc_matrix_integer
  235. typedef detail::tmat4x4<lowp_uint> lowp_umat4;
  236. /// Low-precision unsigned integer 2x2 matrix.
  237. /// @see gtc_matrix_integer
  238. typedef detail::tmat2x2<lowp_uint> lowp_umat2x2;
  239. /// Low-precision unsigned integer 2x3 matrix.
  240. /// @see gtc_matrix_integer
  241. typedef detail::tmat2x3<lowp_uint> lowp_umat2x3;
  242. /// Low-precision unsigned integer 2x4 matrix.
  243. /// @see gtc_matrix_integer
  244. typedef detail::tmat2x4<lowp_uint> lowp_umat2x4;
  245. /// Low-precision unsigned integer 3x2 matrix.
  246. /// @see gtc_matrix_integer
  247. typedef detail::tmat3x2<lowp_uint> lowp_umat3x2;
  248. /// Low-precision unsigned integer 3x3 matrix.
  249. /// @see gtc_matrix_integer
  250. typedef detail::tmat3x3<lowp_uint> lowp_umat3x3;
  251. /// Low-precision unsigned integer 3x4 matrix.
  252. /// @see gtc_matrix_integer
  253. typedef detail::tmat3x4<lowp_uint> lowp_umat3x4;
  254. /// Low-precision unsigned integer 4x2 matrix.
  255. /// @see gtc_matrix_integer
  256. typedef detail::tmat4x2<lowp_uint> lowp_umat4x2;
  257. /// Low-precision unsigned integer 4x3 matrix.
  258. /// @see gtc_matrix_integer
  259. typedef detail::tmat4x3<lowp_uint> lowp_umat4x3;
  260. /// Low-precision unsigned integer 4x4 matrix.
  261. /// @see gtc_matrix_integer
  262. typedef detail::tmat4x4<lowp_uint> lowp_umat4x4;
  263. #if(defined(GLM_PRECISION_HIGHP_INT))
  264. typedef highp_imat2 imat2;
  265. typedef highp_imat3 imat3;
  266. typedef highp_imat4 imat4;
  267. typedef highp_imat2x2 imat2x2;
  268. typedef highp_imat2x3 imat2x3;
  269. typedef highp_imat2x4 imat2x4;
  270. typedef highp_imat3x2 imat3x2;
  271. typedef highp_imat3x3 imat3x3;
  272. typedef highp_imat3x4 imat3x4;
  273. typedef highp_imat4x2 imat4x2;
  274. typedef highp_imat4x3 imat4x3;
  275. typedef highp_imat4x4 imat4x4;
  276. #elif(defined(GLM_PRECISION_LOWP_INT))
  277. typedef lowp_imat2 imat2;
  278. typedef lowp_imat3 imat3;
  279. typedef lowp_imat4 imat4;
  280. typedef lowp_imat2x2 imat2x2;
  281. typedef lowp_imat2x3 imat2x3;
  282. typedef lowp_imat2x4 imat2x4;
  283. typedef lowp_imat3x2 imat3x2;
  284. typedef lowp_imat3x3 imat3x3;
  285. typedef lowp_imat3x4 imat3x4;
  286. typedef lowp_imat4x2 imat4x2;
  287. typedef lowp_imat4x3 imat4x3;
  288. typedef lowp_imat4x4 imat4x4;
  289. #else //if(defined(GLM_PRECISION_MEDIUMP_INT))
  290. /// Signed integer 2x2 matrix.
  291. /// @see gtc_matrix_integer
  292. typedef mediump_imat2 imat2;
  293. /// Signed integer 3x3 matrix.
  294. /// @see gtc_matrix_integer
  295. typedef mediump_imat3 imat3;
  296. /// Signed integer 4x4 matrix.
  297. /// @see gtc_matrix_integer
  298. typedef mediump_imat4 imat4;
  299. /// Signed integer 2x2 matrix.
  300. /// @see gtc_matrix_integer
  301. typedef mediump_imat2x2 imat2x2;
  302. /// Signed integer 2x3 matrix.
  303. /// @see gtc_matrix_integer
  304. typedef mediump_imat2x3 imat2x3;
  305. /// Signed integer 2x4 matrix.
  306. /// @see gtc_matrix_integer
  307. typedef mediump_imat2x4 imat2x4;
  308. /// Signed integer 3x2 matrix.
  309. /// @see gtc_matrix_integer
  310. typedef mediump_imat3x2 imat3x2;
  311. /// Signed integer 3x3 matrix.
  312. /// @see gtc_matrix_integer
  313. typedef mediump_imat3x3 imat3x3;
  314. /// Signed integer 3x4 matrix.
  315. /// @see gtc_matrix_integer
  316. typedef mediump_imat3x4 imat3x4;
  317. /// Signed integer 4x2 matrix.
  318. /// @see gtc_matrix_integer
  319. typedef mediump_imat4x2 imat4x2;
  320. /// Signed integer 4x3 matrix.
  321. /// @see gtc_matrix_integer
  322. typedef mediump_imat4x3 imat4x3;
  323. /// Signed integer 4x4 matrix.
  324. /// @see gtc_matrix_integer
  325. typedef mediump_imat4x4 imat4x4;
  326. #endif//GLM_PRECISION
  327. #if(defined(GLM_PRECISION_HIGHP_UINT))
  328. typedef highp_umat2 umat2;
  329. typedef highp_umat3 umat3;
  330. typedef highp_umat4 umat4;
  331. typedef highp_umat2x2 umat2x2;
  332. typedef highp_umat2x3 umat2x3;
  333. typedef highp_umat2x4 umat2x4;
  334. typedef highp_umat3x2 umat3x2;
  335. typedef highp_umat3x3 umat3x3;
  336. typedef highp_umat3x4 umat3x4;
  337. typedef highp_umat4x2 umat4x2;
  338. typedef highp_umat4x3 umat4x3;
  339. typedef highp_umat4x4 umat4x4;
  340. #elif(defined(GLM_PRECISION_LOWP_UINT))
  341. typedef lowp_umat2 umat2;
  342. typedef lowp_umat3 umat3;
  343. typedef lowp_umat4 umat4;
  344. typedef lowp_umat2x2 umat2x2;
  345. typedef lowp_umat2x3 umat2x3;
  346. typedef lowp_umat2x4 umat2x4;
  347. typedef lowp_umat3x2 umat3x2;
  348. typedef lowp_umat3x3 umat3x3;
  349. typedef lowp_umat3x4 umat3x4;
  350. typedef lowp_umat4x2 umat4x2;
  351. typedef lowp_umat4x3 umat4x3;
  352. typedef lowp_umat4x4 umat4x4;
  353. #else //if(defined(GLM_PRECISION_MEDIUMP_UINT))
  354. /// Unsigned integer 2x2 matrix.
  355. /// @see gtc_matrix_integer
  356. typedef mediump_umat2 umat2;
  357. /// Unsigned integer 3x3 matrix.
  358. /// @see gtc_matrix_integer
  359. typedef mediump_umat3 umat3;
  360. /// Unsigned integer 4x4 matrix.
  361. /// @see gtc_matrix_integer
  362. typedef mediump_umat4 umat4;
  363. /// Unsigned integer 2x2 matrix.
  364. /// @see gtc_matrix_integer
  365. typedef mediump_umat2x2 umat2x2;
  366. /// Unsigned integer 2x3 matrix.
  367. /// @see gtc_matrix_integer
  368. typedef mediump_umat2x3 umat2x3;
  369. /// Unsigned integer 2x4 matrix.
  370. /// @see gtc_matrix_integer
  371. typedef mediump_umat2x4 umat2x4;
  372. /// Unsigned integer 3x2 matrix.
  373. /// @see gtc_matrix_integer
  374. typedef mediump_umat3x2 umat3x2;
  375. /// Unsigned integer 3x3 matrix.
  376. /// @see gtc_matrix_integer
  377. typedef mediump_umat3x3 umat3x3;
  378. /// Unsigned integer 3x4 matrix.
  379. /// @see gtc_matrix_integer
  380. typedef mediump_umat3x4 umat3x4;
  381. /// Unsigned integer 4x2 matrix.
  382. /// @see gtc_matrix_integer
  383. typedef mediump_umat4x2 umat4x2;
  384. /// Unsigned integer 4x3 matrix.
  385. /// @see gtc_matrix_integer
  386. typedef mediump_umat4x3 umat4x3;
  387. /// Unsigned integer 4x4 matrix.
  388. /// @see gtc_matrix_integer
  389. typedef mediump_umat4x4 umat4x4;
  390. #endif//GLM_PRECISION
  391. /// @}
  392. }//namespace glm
  393. #endif//GLM_GTC_matrix_integer