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.
 
 
 
 
 
 

156 lines
4.0 KiB

  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (ASSIMP)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2009, ASSIMP Development Team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the ASSIMP team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the ASSIMP Development Team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /**
  35. * Mathematical structures in which the imported data is stored.
  36. */
  37. module assimp.math;
  38. extern( C ) {
  39. /**
  40. * Represents a two-dimensional vector.
  41. */
  42. struct aiVector2D {
  43. align ( 1 ):
  44. float x, y;
  45. }
  46. /**
  47. * Represents a three-dimensional vector.
  48. */
  49. struct aiVector3D {
  50. align ( 1 ):
  51. float x, y, z;
  52. }
  53. /**
  54. * Represents a quaternion.
  55. */
  56. struct aiQuaternion {
  57. float w, x, y, z;
  58. }
  59. /**
  60. * Represents a row-major 3x3 matrix
  61. *
  62. * There is much confusion about matrix layouts (colum vs. row order). This
  63. * is <em>always</em> a row-major matrix, even when using the
  64. * <code>ConvertToLeftHanded</code> post processing step.
  65. */
  66. struct aiMatrix3x3 {
  67. float a1, a2, a3;
  68. float b1, b2, b3;
  69. float c1, c2, c3;
  70. }
  71. /**
  72. * Represents a row-major 3x3 matrix
  73. *
  74. * There is much confusion about matrix layouts (colum vs. row order). This
  75. * is <em>always</em> a row-major matrix, even when using the
  76. * <code>ConvertToLeftHanded</code> post processing step.
  77. */
  78. struct aiMatrix4x4 {
  79. align ( 1 ):
  80. float a1, a2, a3, a4;
  81. float b1, b2, b3, b4;
  82. float c1, c2, c3, c4;
  83. float d1, d2, d3, d4;
  84. }
  85. /**
  86. * Represents a plane in a three-dimensional, euclidean space
  87. */
  88. struct aiPlane {
  89. align ( 1 ):
  90. /**
  91. * Coefficients of the plane equation (<code>ax + by + cz = d</code>).
  92. */
  93. float a;
  94. float b; /// ditto
  95. float c; /// ditto
  96. float d; /// ditto
  97. }
  98. /**
  99. * Represents a ray.
  100. */
  101. struct aiRay {
  102. align ( 1 ):
  103. /**
  104. * Origin of the ray.
  105. */
  106. aiVector3D pos;
  107. /**
  108. * Direction of the ray.
  109. */
  110. aiVector3D dir;
  111. }
  112. /**
  113. * Represents a color in RGB space.
  114. */
  115. struct aiColor3D {
  116. align ( 1 ):
  117. /**
  118. * Red, green and blue values.
  119. */
  120. float r;
  121. float g; /// ditto
  122. float b; /// ditto
  123. }
  124. /**
  125. * Represents a color in RGB space including an alpha component.
  126. */
  127. struct aiColor4D {
  128. align ( 1 ):
  129. /**
  130. * Red, green, blue and alpha values.
  131. */
  132. float r;
  133. float g; /// ditto
  134. float b; /// ditto
  135. float a; /// ditto
  136. }
  137. }