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.

152 lines
3.8 KiB

  1. unit ugluMatrixEx;
  2. {$mode objfpc}{$H+}
  3. {$macro on}
  4. {$modeswitch typehelpers}
  5. interface
  6. uses
  7. Classes, SysUtils,
  8. ugluVectorEx, ugluMatrixExHelper;
  9. const
  10. maAxisX = 0;
  11. maAxisY = 1;
  12. maAxisZ = 2;
  13. maPos = 3;
  14. type
  15. TgluMatrix2f = TgluMatrixF.TMat2;
  16. TgluMatrix3f = TgluMatrixF.TMat3;
  17. TgluMatrix4f = TgluMatrixF.TMat4;
  18. TgluMatrix2d = TgluMatrixD.TMat2;
  19. TgluMatrix3d = TgluMatrixD.TMat3;
  20. TgluMatrix4d = TgluMatrixD.TMat4;
  21. PgluMatrix2f = ^TgluMatrix2f;
  22. PgluMatrix3f = ^TgluMatrix3f;
  23. PgluMatrix4f = ^TgluMatrix4f;
  24. PgluMatrix2d = ^TgluMatrix2d;
  25. PgluMatrix3d = ^TgluMatrix3d;
  26. PgluMatrix4d = ^TgluMatrix4d;
  27. {$DEFINE __MATRIX_HELPER_INTERFACE}
  28. {$DEFINE __VEC2 := TgluVector2f}
  29. {$DEFINE __VEC3 := TgluVector3f}
  30. {$DEFINE __VEC4 := TgluVector4f}
  31. {$DEFINE __IMPL := TgluMatrixF}
  32. {$DEFINE __SIZE := 2}
  33. {$DEFINE __VEC := TgluVector2f}
  34. {$DEFINE __MAT := TgluMatrix2f}
  35. {$DEFINE __HELPER := TgluTypeHelperMatrix2f}
  36. {$I ugluMatrixEx.inc}
  37. {$DEFINE __IMPL := TgluMatrixF}
  38. {$DEFINE __SIZE := 3}
  39. {$DEFINE __VEC := TgluVector3f}
  40. {$DEFINE __MAT := TgluMatrix3f}
  41. {$DEFINE __HELPER := TgluTypeHelperMatrix3f}
  42. {$I ugluMatrixEx.inc}
  43. {$DEFINE __IMPL := TgluMatrixF}
  44. {$DEFINE __SIZE := 4}
  45. {$DEFINE __VEC := TgluVector4f}
  46. {$DEFINE __MAT := TgluMatrix4f}
  47. {$DEFINE __HELPER := TgluTypeHelperMatrix4f}
  48. {$I ugluMatrixEx.inc}
  49. {$DEFINE __VEC2 := TgluVector2d}
  50. {$DEFINE __VEC3 := TgluVector3d}
  51. {$DEFINE __VEC4 := TgluVector4d}
  52. {$DEFINE __IMPL := TgluMatrixD}
  53. {$DEFINE __SIZE := 2}
  54. {$DEFINE __VEC := TgluVector2d}
  55. {$DEFINE __MAT := TgluMatrix2d}
  56. {$DEFINE __HELPER := TgluTypeHelperMatrix2d}
  57. {$I ugluMatrixEx.inc}
  58. {$DEFINE __IMPL := TgluMatrixD}
  59. {$DEFINE __SIZE := 3}
  60. {$DEFINE __VEC := TgluVector3d}
  61. {$DEFINE __MAT := TgluMatrix3d}
  62. {$DEFINE __HELPER := TgluTypeHelperMatrix3d}
  63. {$I ugluMatrixEx.inc}
  64. {$DEFINE __IMPL := TgluMatrixD}
  65. {$DEFINE __SIZE := 4}
  66. {$DEFINE __VEC := TgluVector4d}
  67. {$DEFINE __MAT := TgluMatrix4d}
  68. {$DEFINE __HELPER := TgluTypeHelperMatrix4d}
  69. {$I ugluMatrixEx.inc}
  70. {$UNDEF __MATRIX_HELPER_INTERFACE}
  71. implementation
  72. {$DEFINE __MATRIX_HELPER_IMPL}
  73. {$DEFINE __VEC2 := TgluVector2f}
  74. {$DEFINE __VEC3 := TgluVector3f}
  75. {$DEFINE __VEC4 := TgluVector4f}
  76. {$DEFINE __IMPL := TgluMatrixF}
  77. {$DEFINE __SIZE := 2}
  78. {$DEFINE __VEC := TgluVector2f}
  79. {$DEFINE __MAT := TgluMatrix2f}
  80. {$DEFINE __HELPER := TgluTypeHelperMatrix2f}
  81. {$I ugluMatrixEx.inc}
  82. {$DEFINE __IMPL := TgluMatrixF}
  83. {$DEFINE __SIZE := 3}
  84. {$DEFINE __VEC := TgluVector3f}
  85. {$DEFINE __MAT := TgluMatrix3f}
  86. {$DEFINE __HELPER := TgluTypeHelperMatrix3f}
  87. {$I ugluMatrixEx.inc}
  88. {$DEFINE __IMPL := TgluMatrixF}
  89. {$DEFINE __SIZE := 4}
  90. {$DEFINE __VEC := TgluVector4f}
  91. {$DEFINE __MAT := TgluMatrix4f}
  92. {$DEFINE __HELPER := TgluTypeHelperMatrix4f}
  93. {$I ugluMatrixEx.inc}
  94. {$DEFINE __VEC2 := TgluVector2d}
  95. {$DEFINE __VEC3 := TgluVector3d}
  96. {$DEFINE __VEC4 := TgluVector4d}
  97. {$DEFINE __IMPL := TgluMatrixD}
  98. {$DEFINE __SIZE := 2}
  99. {$DEFINE __VEC := TgluVector2d}
  100. {$DEFINE __MAT := TgluMatrix2d}
  101. {$DEFINE __HELPER := TgluTypeHelperMatrix2d}
  102. {$I ugluMatrixEx.inc}
  103. {$DEFINE __IMPL := TgluMatrixD}
  104. {$DEFINE __SIZE := 3}
  105. {$DEFINE __VEC := TgluVector3d}
  106. {$DEFINE __MAT := TgluMatrix3d}
  107. {$DEFINE __HELPER := TgluTypeHelperMatrix3d}
  108. {$I ugluMatrixEx.inc}
  109. {$DEFINE __IMPL := TgluMatrixD}
  110. {$DEFINE __SIZE := 4}
  111. {$DEFINE __VEC := TgluVector4d}
  112. {$DEFINE __MAT := TgluMatrix4d}
  113. {$DEFINE __HELPER := TgluTypeHelperMatrix4d}
  114. {$I ugluMatrixEx.inc}
  115. {$UNDEF __MATRIX_HELPER_IMPL}
  116. end.