Line3.html 4.9 KB

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