Line3.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 specified, the result will be copied into this [page:Vector3],
  32. otherwise a new [page:Vector3] will be created.<br /><br />
  33. Return a vector at a certain position along the line. When [page:Float t] = 0, it returns the start vector,
  34. and when [page:Float t] = 1 it returns the end vector.<br />
  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 specified, the result will be copied into this [page:Vector3],
  43. otherwise a new [page:Vector3] will be created.<br /><br />
  44. Returns the closets point on the line. If [page:Boolean clampToLine] is true, then the returned value will be
  45. clamped to the line segment.
  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 specified, the result will be copied into this [page:Vector3],
  59. otherwise a new [page:Vector3] will be created.<br /><br />
  60. Returns the delta vector of the line segment ( [page:.end end] vector minus the [page:.start start] vector).
  61. </div>
  62. <h3>[method:Float distance]()</h3>
  63. <div>Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  64. (straight-line distance) between the line's [page:.start start] and [page:.end end] points.</div>
  65. <h3>[method:Float distanceSq]()</h3>
  66. <div>
  67. Returns the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  68. (straight-line distance) between the line's [page:.start start]
  69. and [page:.end end] vectors.
  70. </div>
  71. <h3>[method:Boolean equals]( [page:Line3 line] )</h3>
  72. <div>
  73. [page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
  74. Returns true if both line's [page:.start start] and [page:.end en] points are equal.
  75. </div>
  76. <h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] )</h3>
  77. <div>
  78. [page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
  79. otherwise a new [page:Vector3] will be created.<br /><br />
  80. Return the center of the line segment.
  81. </div>
  82. <h3>[method:Line3 set]( [page:Vector3 start], [page:Vector3 end] )</h3>
  83. <div>
  84. [page:Vector3 start] - set the [page:.start start point] of the line.<br />
  85. end - [page:Vector3] - set the [page:.end end point] of the line.<br /><br />
  86. Sets the start and end values by copying the provided vectors.
  87. </div>
  88. <h2>Source</h2>
  89. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  90. </body>
  91. </html>