Vector4.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <h1>[name]</h1>
  2. <div class="desc">4D vector.</div>
  3. <h2>Constructor</h2>
  4. <h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
  5. <h2>Properties</h2>
  6. <h3>.[page:Float x]</h3>
  7. <h3>.[page:Float y]</h3>
  8. <h3>.[page:Float z]</h3>
  9. <h3>.[page:Float w]</h3>
  10. <h2>Methods</h2>
  11. <h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:Float w] ) [page:Vector4]</h3>
  12. <div>
  13. Sets value of this vector.
  14. </div>
  15. <h3>.copy( [page:Vector4 v] ) [page:Vector4]</h3>
  16. <div>
  17. Copies value of *v* to this vector.
  18. </div>
  19. <h3>.add( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
  20. <div>
  21. Sets this vector to *a + b*.
  22. </div>
  23. <h3>.addSelf( [page:Vector4 v] ) [page:Vector4s]</h3>
  24. <div>
  25. Adds *v* to this vector.
  26. </div>
  27. <h3>.sub( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
  28. <div>
  29. Sets this vector to *a - b*.
  30. </div>
  31. <h3>.subSelf( [page:Vector4 v] ) [page:Vector4]</h3>
  32. <div>
  33. Subtracts *v* from this vector.
  34. </div>
  35. <h3>.multiplyScalar( [page:Float s] ) [page:Vector4]</h3>
  36. <div>
  37. Multiplies this vector by scalar *s*.
  38. </div>
  39. <h3>.divideScalar( [page:Float s] ) [page:Vector4]</h3>
  40. <div>
  41. Divides this vector by scalar *s*.<br />
  42. Set vector to *( 0, 0, 0 )* if *s == 0*.
  43. </div>
  44. <h3>.negate() [page:Vector4]</h3>
  45. <div>
  46. Inverts this vector.
  47. </div>
  48. <h3>.dot( [page:Vector4 v] ) [page:Float]</h3>
  49. <div>
  50. Computes dot product of this vector and *v*.
  51. </div>
  52. <h3>.lengthSq() [page:Float]</h3>
  53. <div>
  54. Computes squared length of this vector.
  55. </div>
  56. <h3>.length() [page:Float]</h3>
  57. <div>
  58. Computes length of this vector.
  59. </div>
  60. <h3>.normalize() [page:Vector4]</h3>
  61. <div>
  62. Normalizes this vector.
  63. </div>
  64. <h3>.setLength( [page:Float l] ) [page:Vector3]</h3>
  65. <div>
  66. Normalizes this vector and multiplies it by *l*.
  67. </div>
  68. <h3>.lerpSelf( [page:Vector4 v], [page:Float alpha] ) [page:Vector4]</h3>
  69. <div>
  70. Linearly interpolate between this vector and *v* with *alpha* factor.
  71. </div>
  72. <h3>.clone() [page:Vector3]</h3>
  73. <div>
  74. Clones this vector.
  75. </div>
  76. <h2>Source</h2>
  77. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]