Line3.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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">用起点和终点表示的几何线段。</p>
  12. <h2>构造器(Constructor)</h2>
  13. <h3>[name]( [param:Vector3 start], [param:Vector3 end] )</h3>
  14. <p>
  15. [page:Vector3 start] - 线段的起始点。默认值为 (0, 0, 0)。<br />
  16. [page:Vector3 end] - 线段的终点。默认值为 (0, 0, 0)。<br /><br />
  17. 创建一个三维几何线段 [name]。
  18. </p>
  19. <h2>属性(Properties)</h2>
  20. <h3>[property:Vector3 start]</h3>
  21. <p>[page:Vector3] 表示线段的起点。</p>
  22. <h3>[property:Vector3 end]</h3>
  23. <p>[page:Vector3] 表示线段的终点</p>
  24. <h2>方法(Methods)</h2>
  25. <h3>[method:this applyMatrix4]( [param:Matrix4 matrix] )</h3>
  26. <p>对此线段应用矩阵变换。</p>
  27. <h3>[method:Vector3 at]( [param:Float t], [param:Vector3 target] )</h3>
  28. <p>
  29. [page:Float t] - 使用值0-1返回沿线段的位置。<br />
  30. [page:Vector3 target] — 计算结果会被拷贝到target。<br /><br />
  31. 返回一个线段某一位置的向量,当 [page:Float t] = 0的时候返回起始点,当[page:Float t] = 1的时候返回终点。<br />
  32. </p>
  33. <h3>[method:Line3 clone]()</h3>
  34. <p>返回一个与此线段拥有相同起始点 [page:.start start] 和 终点[page:.end end] 的线段。</p>
  35. <h3>[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Boolean clampToLine], [param:Vector3 target] )</h3>
  36. <p>
  37. [page:Vector3 point] - 用于计算线段上到该点最近的点。<br />
  38. [page:Boolean clampToLine] - 是否将结果限制在线段起始点和终点之间。<br />
  39. [page:Vector3 target] — 结果会拷贝到target。<br /><br />
  40. 返回线段上到point最近的点。如果参数 [page:Boolean clampToLine] 为true。返回值将会在线段之间。
  41. </p>
  42. <h3>[method:Float closestPointToPointParameter]( [param:Vector3 point], [param:Boolean clampToLine] )</h3>
  43. <p>
  44. [page:Vector3 point] - 用于计算返回值的点 <br />
  45. [page:Boolean clampToLine] - 结果是否处于 [0, 1]之间。<br /><br />
  46. 返回一个基于点投影到线段上的点的参数。如果 [page:Boolean clampToLine] 为true则返回值将在0到1之间。
  47. </p>
  48. <h3>[method:this copy]( [param:Line3 line] )</h3>
  49. <p>拷贝传入线段的起始点 [page:.start start] 和终点 [page:.end end] 向量到当前线段。</p>
  50. <h3>[method:Vector3 delta]( [param:Vector3 target] )</h3>
  51. <p>
  52. [page:Vector3 target] — 结果将会拷贝到target。<br /><br />
  53. 返回线段的向量。(终点[page:.end end]向量减去起始点[page:.start start]向量)。
  54. </p>
  55. <h3>[method:Float distance]()</h3>
  56. <p>Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
  57. (straight-line distance) between the line's [page:.start start] and [page:.end end] points.</p>
  58. <h3>[method:Float distanceSq]()</h3>
  59. <p>
  60. 返回起始点[page:.start start]和终点[page:.end end]的欧几里得距离[link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]。(直线距离)
  61. </p>
  62. <h3>[method:Boolean equals]( [param:Line3 line] )</h3>
  63. <p>
  64. [page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
  65. 如果给定线段与当前线段的起始点[page:.start start]和终点[page:.end end]都相同则返回true。
  66. </p>
  67. <h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
  68. <p>
  69. [page:Vector3 target] — 结果会写入target。<br /><br />
  70. 返回线段的中心点。
  71. </p>
  72. <h3>[method:this set]( [param:Vector3 start], [param:Vector3 end] )</h3>
  73. <p>
  74. [page:Vector3 start] - 设置线段的起点 [page:.start start point]。<br />
  75. [page:Vector3 end] - 设置线段的终点 [page:.end end point]。<br /><br />
  76. 将传入的向量设置到线段的起始点和终点。
  77. </p>
  78. <h2>源码(Source)</h2>
  79. <p>
  80. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  81. </p>
  82. </body>
  83. </html>