Line3.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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],
  46. [param:Boolean clampToLine], [param:Vector3 target] )
  47. </h3>
  48. <p>
  49. [page:Vector3 point] - return the closest point on the line to this
  50. point.<br />
  51. [page:Boolean clampToLine] - whether to clamp the returned value to the
  52. line segment.<br />
  53. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  54. Returns the closets point on the line. If [page:Boolean clampToLine] is
  55. true, then the returned value will be clamped to the line segment.
  56. </p>
  57. <h3>
  58. [method:Float closestPointToPointParameter]( [param:Vector3 point],
  59. [param:Boolean clampToLine] )
  60. </h3>
  61. <p>
  62. [page:Vector3 point] - the point for which to return a point parameter.
  63. <br />
  64. [page:Boolean clampToLine] - Whether to clamp the result to the range `[0,
  65. 1]`.<br /><br />
  66. Returns a point parameter based on the closest point as projected on the
  67. line segment. If [page:Boolean clampToLine] is true, then the returned
  68. value will be between 0 and 1.
  69. </p>
  70. <h3>[method:this copy]( [param:Line3 line] )</h3>
  71. <p>
  72. Copies the passed line's [page:.start start] and [page:.end end] vectors
  73. to this line.
  74. </p>
  75. <h3>[method:Vector3 delta]( [param:Vector3 target] )</h3>
  76. <p>
  77. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  78. Returns the delta vector of the line segment ( [page:.end end] vector
  79. minus the [page:.start start] vector).
  80. </p>
  81. <h3>[method:Float distance]()</h3>
  82. <p>
  83. Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  84. (straight-line distance) between the line's
  85. [page:.start start] and [page:.end end] points.
  86. </p>
  87. <h3>[method:Float distanceSq]()</h3>
  88. <p>
  89. Returns the square of the
  90. [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  91. (straight-line distance) between the line's [page:.start start] and
  92. [page:.end end] vectors.
  93. </p>
  94. <h3>[method:Boolean equals]( [param:Line3 line] )</h3>
  95. <p>
  96. [page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
  97. Returns true if both line's [page:.start start] and [page:.end end] points
  98. are equal.
  99. </p>
  100. <h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
  101. <p>
  102. [page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
  103. Returns the center of the line segment.
  104. </p>
  105. <h3>[method:this set]( [param:Vector3 start], [param:Vector3 end] )</h3>
  106. <p>
  107. [page:Vector3 start] - set the [page:.start start point] of the line.<br />
  108. [page:Vector3 end] - set the [page:.end end point] of the line.<br /><br />
  109. Sets the start and end values by copying the provided vectors.
  110. </p>
  111. <h2>Source</h2>
  112. <p>
  113. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  114. </p>
  115. </body>
  116. </html>