Matrix4.rst 6.0 KB

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