Line3.html 4.3 KB

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