Line3.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  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. <p class="desc">
  12. A geometric line segment represented by a start and end point.
  13. </p>
  14. <h2>Constructor</h2>
  15. <h3>[name]( [param:Vector3 start], [param:Vector3 end] )</h3>
  16. <p>
  17. [page:Vector3 start] - Start of the line segment. Default is `(0, 0,
  18. 0)`.<br />
  19. [page:Vector3 end] - End of the line segment. Default is `(0, 0, 0)`.<br /><br />
  20. Creates a new [name].
  21. </p>
  22. <h2>Properties</h2>
  23. <h3>[property:Vector3 start]</h3>
  24. <p>[page:Vector3] representing the start point of the line.</p>
  25. <h3>[property:Vector3 end]</h3>
  26. <p>[page:Vector3] representing the end point of the line.</p>
  27. <h2>Methods</h2>
  28. <h3>[method:this applyMatrix4]( [param:Matrix4 matrix] )</h3>
  29. <p>Applies a matrix transform to the line segment.</p>
  30. <h3>[method:Vector3 at]( [param:Float t], [param:Vector3 target] )</h3>
  31. <p>
  32. [page:Float t] - Use values 0-1 to return a position along the line
  33. segment. <br />
  34. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  35. Returns a vector at a certain position along the line. When [page:Float t]
  36. = 0, it returns the start vector, and when [page:Float t] = 1 it returns
  37. the end vector.<br />
  38. </p>
  39. <h3>[method:Line3 clone]()</h3>
  40. <p>
  41. Returns a new [page:Line3] with the same [page:.start start] and
  42. [page:.end end] vectors as this one.
  43. </p>
  44. <h3>
  45. [method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Boolean clampToLine], [param:Vector3 target] )
  46. </h3>
  47. <p>
  48. [page:Vector3 point] - return the closest point on the line to this
  49. point.<br />
  50. [page:Boolean clampToLine] - whether to clamp the returned value to the
  51. line segment.<br />
  52. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  53. Returns the closets point on the line. If [page:Boolean clampToLine] is
  54. true, then the returned value will be clamped to the line segment.
  55. </p>
  56. <h3>
  57. [method:Float closestPointToPointParameter]( [param:Vector3 point], [param:Boolean clampToLine] )
  58. </h3>
  59. <p>
  60. [page:Vector3 point] - the point for which to return a point parameter.
  61. <br />
  62. [page:Boolean clampToLine] - Whether to clamp the result to the range `[0,
  63. 1]`.<br /><br />
  64. Returns a point parameter based on the closest point as projected on the
  65. line segment. If [page:Boolean clampToLine] is true, then the returned
  66. value will be between `0` and `1`.
  67. </p>
  68. <h3>[method:this copy]( [param:Line3 line] )</h3>
  69. <p>
  70. Copies the passed line's [page:.start start] and [page:.end end] vectors
  71. to this line.
  72. </p>
  73. <h3>[method:Vector3 delta]( [param:Vector3 target] )</h3>
  74. <p>
  75. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  76. Returns the delta vector of the line segment ( [page:.end end] vector
  77. minus the [page:.start start] vector).
  78. </p>
  79. <h3>[method:Float distance]()</h3>
  80. <p>
  81. Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  82. (straight-line distance) between the line's
  83. [page:.start start] and [page:.end end] points.
  84. </p>
  85. <h3>[method:Float distanceSq]()</h3>
  86. <p>
  87. Returns the square of the
  88. [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  89. (straight-line distance) between the line's [page:.start start] and
  90. [page:.end end] vectors.
  91. </p>
  92. <h3>[method:Boolean equals]( [param:Line3 line] )</h3>
  93. <p>
  94. [page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
  95. Returns true if both line's [page:.start start] and [page:.end end] points
  96. are equal.
  97. </p>
  98. <h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
  99. <p>
  100. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  101. Returns the center of the line segment.
  102. </p>
  103. <h3>[method:this set]( [param:Vector3 start], [param:Vector3 end] )</h3>
  104. <p>
  105. [page:Vector3 start] - set the [page:.start start point] of the line.<br />
  106. [page:Vector3 end] - set the [page:.end end point] of the line.<br /><br />
  107. Sets the start and end values by copying the provided vectors.
  108. </p>
  109. <h2>Source</h2>
  110. <p>
  111. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  112. </p>
  113. </body>
  114. </html>