Line3.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  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. <div class="desc">A geometric line segment represented by a start and end point.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]([page:Vector3 start], [page:Vector3 end])</h3>
  14. <div>
  15. start -- [page:Vector3] Start of the line segment<br />
  16. end -- [page:Vector3] End of the line segment
  17. </div>
  18. <div>
  19. The start and end vectors default to origin vectors if none are set.
  20. </div>
  21. <h2>Properties</h2>
  22. <h3>[property:Vector3 start]</h3>
  23. <h3>[property:Vector3 end]</h3>
  24. <h2>Methods</h2>
  25. <h3>[method:Line3 set]([page:Vector3 start], [page:Vector3 end])</h3>
  26. <div>
  27. start -- [page:Vector3] <br />
  28. end -- [page:Vector3]
  29. </div>
  30. <div>
  31. Sets the start and end values by copying the provided vectors.
  32. </div>
  33. <h3>[method:Line3 copy]([page:Line3 line])</h3>
  34. <div>
  35. line -- [page:Line3]
  36. </div>
  37. <div>
  38. Copies the passed line's start and end vectors to this line.
  39. </div>
  40. <h3>[method:Line3 clone]()</h3>
  41. <div>
  42. Return a new copy of this [page:Line3].
  43. </div>
  44. <h3>[method:Boolean equals]([page:Line3 line])</h3>
  45. <div>
  46. line -- [page:Line3]
  47. </div>
  48. <div>
  49. <h3>[method:Float distance]()</h3>
  50. <div>
  51. Returns the length of the line segment.
  52. </div>
  53. Returns true if both line's start and end points are equal.
  54. </div>
  55. <h3>[method:Float distanceSq]()</h3>
  56. <div>
  57. Returns the line segment's length squared.
  58. </div>
  59. <h3>[method:Line3 applyMatrix4]([page:Matrix4 matrix]) [page:Line3 this]</h3>
  60. <div>
  61. matrix -- [page:Matrix4]
  62. </div>
  63. <div>
  64. Apply a matrix transform to the line segment.
  65. </div>
  66. <h3>[method:Vector at]([page:Float t], [page:Vector3 optionalTarget])</h3>
  67. <div>
  68. t -- [page:Float] Use values 0-1 to return a result on the line segment. <br />
  69. optionalTarget -- [page:Vector] Optional target to set the result.
  70. </div>
  71. <div>
  72. Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.
  73. </div>
  74. <h3>[method:Vector3 center]([page:Vector3 optionalTarget])</h3>
  75. <div>
  76. optionalTarget -- [page:Vector3] Optional target to set the result.
  77. </div>
  78. <div>
  79. Return the center of the line segment.
  80. </div>
  81. <h3>[method:Vector3 delta]([page:Vector3 optionalTarget])</h3>
  82. <div>
  83. optionalTarget -- [page:Vector3] Optional target to set the result.
  84. </div>
  85. <div>
  86. Returns the delta vector of the line segment, or the end vector minus the start vector.
  87. </div>
  88. <h3>[method:Vector3 closestPointToPoint]([page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget])</h3>
  89. <div>
  90. point -- [page:Vector3] <br />
  91. clampToLine -- [page:Boolean] <br />
  92. optionalTarget -- [page:Vector3] Optional target to set the result.
  93. </div>
  94. <div>
  95. Returns the closets point on the line. If clamp to line is true, then the returned value will be clamped to the line segment.
  96. </div>
  97. <h3>[method:Float closestPointToPointParameter]([page:Vector3 point], [page:Boolean clampToLine])</h3>
  98. <div>
  99. point -- [page:Vector3] <br />
  100. clampToLine -- [page:Boolean]
  101. </div>
  102. <div>
  103. Returns a point parameter based on the closest point as projected on the line segement. If clamp to line is true, then the returned value will be between 0 and 1.
  104. </div>
  105. <h2>Source</h2>
  106. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  107. </body>
  108. </html>