Line3.html 4.3 KB

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