Vector4.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 a], [page:Vector4 b] ) [page:Vector4]</h3>
  29. <div>
  30. Sets this vector to *a + b*.
  31. </div>
  32. <h3>.addSelf( [page:Vector4 v] ) [page:Vector4]</h3>
  33. <div>
  34. Adds *v* to this vector.
  35. </div>
  36. <h3>.sub( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
  37. <div>
  38. Sets this vector to *a - b*.
  39. </div>
  40. <h3>.subSelf( [page:Vector4 v] ) [page:Vector4]</h3>
  41. <div>
  42. Subtracts *v* from this vector.
  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>.lerpSelf( [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. <h2>Source</h2>
  86. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  87. </body>
  88. </html>