Vector4.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">4D vector.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
  14. <h2>Properties</h2>
  15. <h3>.[page:Float x]</h3>
  16. <h3>.[page:Float y]</h3>
  17. <h3>.[page:Float z]</h3>
  18. <h3>.[page:Float w]</h3>
  19. <h2>Methods</h2>
  20. <h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:Float w] ) [page:Vector4]</h3>
  21. <div>
  22. Sets value of this vector.
  23. </div>
  24. <h3>.copy( [page:Vector4 v] ) [page:Vector4]</h3>
  25. <div>
  26. Copies value of *v* to this vector.
  27. </div>
  28. <h3>.add( [page:Vector4 v] ) [page:Vector4]</h3>
  29. <div>
  30. Adds *v* to this vector.
  31. </div>
  32. <h3>.addVectors( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
  33. <div>
  34. Sets this vector to *a + b*.
  35. </div>
  36. <h3>.sub( [page:Vector4 v] ) [page:Vector4]</h3>
  37. <div>
  38. Subtracts *v* from this vector.
  39. </div>
  40. <h3>.subVectors( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
  41. <div>
  42. Sets this vector to *a - b*.
  43. </div>
  44. <h3>.multiplyScalar( [page:Float s] ) [page:Vector4]</h3>
  45. <div>
  46. Multiplies this vector by scalar *s*.
  47. </div>
  48. <h3>.divideScalar( [page:Float s] ) [page:Vector4]</h3>
  49. <div>
  50. Divides this vector by scalar *s*.<br />
  51. Set vector to *( 0, 0, 0 )* if *s == 0*.
  52. </div>
  53. <h3>.negate() [page:Vector4]</h3>
  54. <div>
  55. Inverts this vector.
  56. </div>
  57. <h3>.dot( [page:Vector4 v] ) [page:Float]</h3>
  58. <div>
  59. Computes dot product of this vector and *v*.
  60. </div>
  61. <h3>.lengthSq() [page:Float]</h3>
  62. <div>
  63. Computes squared length of this vector.
  64. </div>
  65. <h3>.length() [page:Float]</h3>
  66. <div>
  67. Computes length of this vector.
  68. </div>
  69. <h3>.normalize() [page:Vector4]</h3>
  70. <div>
  71. Normalizes this vector.
  72. </div>
  73. <h3>.setLength( [page:Float l] ) [page:Vector4]</h3>
  74. <div>
  75. Normalizes this vector and multiplies it by *l*.
  76. </div>
  77. <h3>.lerp( [page:Vector4 v], [page:Float alpha] ) [page:Vector4]</h3>
  78. <div>
  79. Linearly interpolate between this vector and *v* with *alpha* factor.
  80. </div>
  81. <h3>.clone() [page:Vector4]</h3>
  82. <div>
  83. Clones this vector.
  84. </div>
  85. <h3>.clamp([page:todo min], [page:todo max]) [page:todo]</h3>
  86. <div>
  87. min -- todo <br />
  88. max -- todo
  89. </div>
  90. <div>
  91. todo
  92. </div>
  93. <h3>.toArray() [page:todo]</h3>
  94. <div>
  95. todo
  96. </div>
  97. <h3>.applyMatrix4([page:todo m]) [page:todo]</h3>
  98. <div>
  99. m -- todo
  100. </div>
  101. <div>
  102. todo
  103. </div>
  104. <h3>.min([page:todo v]) [page:todo]</h3>
  105. <div>
  106. v -- todo
  107. </div>
  108. <div>
  109. todo
  110. </div>
  111. <h3>.max([page:todo v]) [page:todo]</h3>
  112. <div>
  113. v -- todo
  114. </div>
  115. <div>
  116. todo
  117. </div>
  118. <h3>.setAxisAngleFromRotationMatrix([page:todo m]) [page:todo]</h3>
  119. <div>
  120. m -- todo
  121. </div>
  122. <div>
  123. todo
  124. </div>
  125. <h3>.addScalar([page:todo s]) [page:todo]</h3>
  126. <div>
  127. s -- todo
  128. </div>
  129. <div>
  130. todo
  131. </div>
  132. <h3>.equals([page:todo v]) [page:todo]</h3>
  133. <div>
  134. v -- todo
  135. </div>
  136. <div>
  137. todo
  138. </div>
  139. <h3>.setAxisAngleFromQuaternion([page:todo q]) [page:todo]</h3>
  140. <div>
  141. q -- todo
  142. </div>
  143. <div>
  144. todo
  145. </div>
  146. <h3>.setW([page:todo w]) [page:todo]</h3>
  147. <div>
  148. w -- todo
  149. </div>
  150. <div>
  151. todo
  152. </div>
  153. <h3>.getComponent([page:todo index]) [page:todo]</h3>
  154. <div>
  155. index -- todo
  156. </div>
  157. <div>
  158. todo
  159. </div>
  160. <h3>.fromArray([page:todo array]) [page:todo]</h3>
  161. <div>
  162. array -- todo
  163. </div>
  164. <div>
  165. todo
  166. </div>
  167. <h3>.lengthManhattan() [page:todo]</h3>
  168. <div>
  169. todo
  170. </div>
  171. <h3>.setComponent([page:todo index], [page:todo value]) [page:todo]</h3>
  172. <div>
  173. index -- todo <br />
  174. value -- todo
  175. </div>
  176. <div>
  177. todo
  178. </div>
  179. <h3>.setX([page:todo x]) [page:todo]</h3>
  180. <div>
  181. x -- todo
  182. </div>
  183. <div>
  184. todo
  185. </div>
  186. <h3>.setY([page:todo y]) [page:todo]</h3>
  187. <div>
  188. y -- todo
  189. </div>
  190. <div>
  191. todo
  192. </div>
  193. <h3>.setZ([page:todo z]) [page:todo]</h3>
  194. <div>
  195. z -- todo
  196. </div>
  197. <div>
  198. todo
  199. </div>
  200. <h2>Source</h2>
  201. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  202. </body>
  203. </html>