Matrix4.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. Matrix4 - A 4x4 Matrix
  2. ----------------------
  3. .. ...............................................................................
  4. .. rubric:: Constructor
  5. .. ...............................................................................
  6. .. class:: Matrix4( [ n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43,n44 ] )
  7. A 4x4 Matrix
  8. .. ...............................................................................
  9. .. rubric:: Attributes
  10. .. ...............................................................................
  11. .. attribute:: Matrix4.n11
  12. .. attribute:: Matrix4.n12
  13. .. attribute:: Matrix4.n13
  14. .. attribute:: Matrix4.n14
  15. .. attribute:: Matrix4.n21
  16. .. attribute:: Matrix4.n22
  17. .. attribute:: Matrix4.n23
  18. .. attribute:: Matrix4.n24
  19. .. attribute:: Matrix4.n31
  20. .. attribute:: Matrix4.n32
  21. .. attribute:: Matrix4.n33
  22. .. attribute:: Matrix4.n34
  23. .. attribute:: Matrix4.n41
  24. .. attribute:: Matrix4.n42
  25. .. attribute:: Matrix4.n43
  26. .. attribute:: Matrix4.n44
  27. .. ...............................................................................
  28. .. rubric:: Methods
  29. .. ...............................................................................
  30. .. function:: Matrix4.set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43,n44)
  31. Sets all fields of this matrix
  32. .. function:: Matrix4.identity()
  33. //todo:description
  34. .. function:: Matrix4.copy(m)
  35. Copies a matrix into this matrix
  36. :param Matrix4 m: Matrix to be copied
  37. .. function:: Matrix4.lookAt(eye,center,up)
  38. //todo:description
  39. :param Vector3 eye: //todo
  40. :param Vector3 center: //todo
  41. :param Vector3 up: //todo
  42. .. function:: Matrix4.multiply(a,b)
  43. //todo:description
  44. :param Matrix4 a: //todo
  45. :param Matrix4 b: //todo
  46. .. function:: Matrix4.multiplySelf(a)
  47. //todo:description
  48. :param Matrix4 a: //todo
  49. .. function:: Matrix4.multiplyToArray(a,b,r)
  50. //todo:description
  51. :param Matrix4 a: //todo
  52. :param Matrix4 b: //todo
  53. :param array r: //todo
  54. .. function:: Matrix4.multiplyScalar(s)
  55. //todo:description
  56. :param float a: //todo
  57. .. function:: Matrix4.multiplyVector3(v)
  58. Applys this matrix to a :class:`Vector3`
  59. :param Vector3 v: //todo
  60. :rtype: Vector3
  61. .. function:: Matrix4.multiplyVector4(v)
  62. Applys this matrix to a :class:`Vector4`
  63. :param Vector4 v: //todo
  64. :rtype: Vector4
  65. .. function:: Matrix4.rotateAxis(v)
  66. //todo:description
  67. :param Vector3 v: //todo
  68. .. function:: Matrix4.crossVector(a)
  69. //todo:description
  70. :param Vector4 a: //todo
  71. .. function:: Matrix4.determinant()
  72. //todo:description
  73. .. function:: Matrix4.transpose()
  74. //todo:description
  75. .. function:: Matrix4.clone()
  76. Clones this matrix
  77. :returns: New instance of this matrix
  78. :rtype: Matrix4
  79. .. function:: Matrix4.flatten()
  80. //todo:description
  81. .. function:: Matrix4.flattenToArray(flat)
  82. //todo:description
  83. :param array flat: //todo
  84. :rtype: array
  85. .. function:: Matrix4.flattenToArrayOffset(flat,offset)
  86. //todo:description
  87. :param array flat: //todo
  88. :param integer offset: //todo
  89. :rtype: array
  90. .. function:: Matrix4.setTranslation(x,y,z)
  91. //todo:description
  92. :param float x: //todo
  93. :param float y: //todo
  94. :param float z: //todo
  95. .. function:: Matrix4.setScale(x,y,z)
  96. //todo:description
  97. :param float x: //todo
  98. :param float y: //todo
  99. :param float z: //todo
  100. .. function:: Matrix4.setRotationX(theta)
  101. //todo:description
  102. :param float theta: Rotation angle in radians
  103. .. function:: Matrix4.setRotationY(theta)
  104. //todo:description
  105. :param float theta: Rotation angle in radians
  106. .. function:: Matrix4.setRotationZ(theta)
  107. //todo:description
  108. :param float theta: Rotation angle in radians
  109. .. function:: Matrix4.setRotationAxis(axis,angle)
  110. //todo:description
  111. :param Vector3 axis: //todo:description
  112. :param float angle: //todo:description
  113. .. function:: Matrix4.setPosition(v)
  114. //todo:description
  115. :param Vector3 v: //todo
  116. .. function:: Matrix4.getPosition()
  117. //todo:description
  118. .. function:: Matrix4.getColumnX()
  119. //todo:description
  120. .. function:: Matrix4.getColumnY()
  121. //todo:description
  122. .. function:: Matrix4.getColumnZ()
  123. //todo:description
  124. .. function:: Matrix4.getInverse(m)
  125. //todo:description
  126. :param Matrix4 m: //todo
  127. .. function:: Matrix4.setRotationFromEuler(v,order)
  128. //todo:description
  129. :param Vector3 v: Vector3 with all the rotations
  130. :param string order: The order of rotations eg. 'XYZ'
  131. .. function:: Matrix4.setRotationFromQuaternion(q)
  132. //todo:description
  133. :param Quaternion q: //todo
  134. .. function:: Matrix4.scale(v)
  135. //todo:description
  136. :param Vector3 v: //todo
  137. .. function:: Matrix4.compose(translation, rotation, scale)
  138. //todo:description
  139. :param Vector3 translation: //todo
  140. :param Quaternion rotation: //todo
  141. :param Vector3 scale: //todo
  142. .. function:: Matrix4.decompose(translation, rotation, scale)
  143. //todo:description
  144. :param Vector3 translation: //todo
  145. :param Quaternion rotation: //todo
  146. :param Vector3 scale: //todo
  147. :returns: //todo
  148. :rtype: //todo
  149. .. function:: Matrix4.extractPosition(m)
  150. //todo:description
  151. :param Matrix4 m:
  152. .. function:: Matrix4.extractRotation(m)
  153. //todo:description
  154. :param Matrix4 m:
  155. .. function:: Matrix4.rotateByAxis(axis,angle)
  156. //todo:description
  157. :param Vector3 axis: //todo:description
  158. :param float angle: //todo:description
  159. .. function:: Matrix4.rotateX(angle)
  160. //todo:description
  161. :param float angle: //todo:description
  162. .. function:: Matrix4.rotateY(angle)
  163. //todo:description
  164. :param float angle: //todo:description
  165. .. function:: Matrix4.rotateZ(angle)
  166. //todo:description
  167. :param float angle: //todo:description
  168. .. function:: Matrix4.translate(v)
  169. :param Vector3 v: //todo:description
  170. .. function:: Matrix4.makeInvert3x3(m)(static)
  171. //todo:description
  172. :param Matrix4 v:
  173. :returns: A 3x3 Matrix
  174. :rtype: Matrix3
  175. .. function:: Matrix4.makeFrustum( left, right, bottom, top, near, far )(static)
  176. //todo:description and parameters
  177. :returns: //todo
  178. :rtype: Matrix4
  179. .. function:: Matrix4.makePerspective( fov, aspect, near, far )(static)
  180. //todo:description and parameters
  181. :returns: //todo
  182. :rtype: Matrix4
  183. .. function:: Matrix4.makeOrtho( left, right, top, bottom, near, far )(static)
  184. //todo:description and parameters
  185. :returns: //todo
  186. :rtype: Matrix4
  187. .. ...............................................................................
  188. .. rubric:: Example
  189. .. ...............................................................................
  190. ::
  191. //todo::example