Sphere.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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>构造函数</h2>
  13. <h3>[name]( [param:Vector3 center], [param:Float radius] )</h3>
  14. <p>
  15. [page:Vector3 center] - 球心的位置,默认值是一个位于(0, 0, 0)的[page:Vector3]。<br />
  16. [page:Float radius] - 球的半径,默认值是-1。<br /><br />
  17. 创建一个新的[name]。
  18. </p>
  19. <h2>属性</h2>
  20. <h3>[property:Vector3 center]</h3>
  21. <p>A [page:Vector3]定义了球心的位置,默认值位于(0, 0, 0)。</p>
  22. <h3>[property:Float radius]</h3>
  23. <p>球的半径,默认值为0。</p>
  24. <h2>方法</h2>
  25. <h3>[method:Sphere applyMatrix4]( [param:Matrix4 matrix] )</h3>
  26. <p>
  27. [page:Matrix4 matrix] - 将被应用的[Page:Matrix4]矩阵。<br /><br />
  28. 使用所传入的[page:Matrix4]矩阵来对球进行变换。
  29. </p>
  30. <h3>[method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
  31. <p>
  32. [page:Vector3 point] - [page:Vector3] 将要夹取的点。<br />
  33. [page:Vector3 target] — 结果将被复制到这个Vector3中。<br /><br />
  34. 从球中夹取一个点。若这一点位于球外,则将会夹取到该点球边缘最近的点。已位于球中的点将不会受到影响。
  35. </p>
  36. <h3>[method:Sphere clone]()</h3>
  37. <p>返回一个新的球,新的球与这个球具有相同的[page:.center center]和[page:.radius radius]。</p>
  38. <h3>[method:Boolean containsPoint]( [param:Vector3 point] )</h3>
  39. <p>
  40. [page:Vector3 point] - the [page:Vector3] to be checked<br /><br />
  41. 检查球体中是否包含所传入的[page:Vector3 point]点,包括球的表面。
  42. </p>
  43. <h3>[method:Sphere copy]( [param:Sphere sphere] )</h3>
  44. <p>
  45. 复制所传入的球的[page:.center center]和[page:.radius radius]到这个球上。
  46. </p>
  47. <h3>[method:Float distanceToPoint]( [param:Vector3 point] )</h3>
  48. <p>
  49. 返回球的边界到所传入的[page:Vector3 point]点的最近距离。
  50. 若这个点,则距离将为负值。
  51. </p>
  52. <h3>[method:this expandByPoint]( [param:Vector3 point] )</h3>
  53. <p>
  54. [page:Vector3 point] - [page:Vector3] that should be included in the sphere.<br /><br />
  55. Expands the boundaries of this sphere to include [page:Vector3 point].
  56. </p>
  57. <h3>[method:Boolean isEmpty]()</h3>
  58. <p>
  59. 检查球是否为空(the radius set to a negative number).
  60. Spheres with a radius of 0 contain only their center point and are not considered to be empty.
  61. </p>
  62. <h3>[method:Sphere makeEmpty]()</h3>
  63. <p>Makes the sphere empty by setting [page:.center center] to (0, 0, 0) and [page:.radius radius] to -1.</p>
  64. <h3>[method:Boolean equals]( [param:Sphere sphere] )</h3>
  65. <p>
  66. 检查这两个球的球心与半径是否相等。
  67. </p>
  68. <h3>[method:Box3 getBoundingBox]( [param:Box3 target] )</h3>
  69. <p>
  70. [page:Box3 target] — 结果将被复制到这个Box3中。<br /><br />
  71. 返回这个球的[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box](最小包围盒)。
  72. </p>
  73. <h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
  74. <p>
  75. [page:Box3 box] - 将被用于测试是否与这个球有交集的[page:Box3]。<br /><br />
  76. 检测这个球与所传入的[page:Box3 box]是否有交集。
  77. </p>
  78. <h3>[method:Boolean intersectsPlane]( [param:Plane plane] )</h3>
  79. <p>
  80. [page:Plane plane] - 将被用于测试是否与这个球有交集的Plane。<br /><br />
  81. 检测这个球与所传入的[page:Plane plane]是否有交集。
  82. </p>
  83. <h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
  84. <p>
  85. [page:Sphere sphere] - 将被用于测试是否与这个球有交集的Sphere。<br /><br />
  86. 检测两球之间是否有交集。
  87. </p>
  88. <h3>[method:Sphere set]( [param:Vector3 center], [param:Float radius] )</h3>
  89. <p>
  90. [page:Vector3 center] - 球心位置。<br />
  91. [page:Float radius] - 球的半径。<br /><br />
  92. 设置球的[page:.center center]和[page:.radius radius]属性。<br>
  93. Please note that this method only copies the values from the given center.
  94. </p>
  95. <h3>[method:Sphere setFromPoints]( [param:Array points], [param:Vector3 optionalCenter] )</h3>
  96. <p>
  97. [page:Array points] - 一个包含有[page:Vector3]位置的[page:Array]。<br />
  98. [page:Vector3 optionalCenter] - 可选, [page:Vector3] 球心位置。<br /><br />
  99. 计算一个[page:Array points]数组(中的点)的最小边界球。如果给定了[page:Vector3 optionalCenter],则它将被用作该球的球心;
  100. 否则,环绕[page:Array points]的包围盒的轴心将通过计算来得到。
  101. </p>
  102. <h3>[method:Sphere translate]( [param:Vector3 offset] )</h3>
  103. <p>
  104. 使用所给定[page:Vector3] offset(偏移量)平移球心。
  105. </p>
  106. <h3>[method:this union]( [param:Sphere sphere] )</h3>
  107. <p>
  108. [page:Sphere sphere] - Bounding sphere that will be unioned with this sphere.<br /><br />
  109. Expands this sphere to enclose both the original sphere and the given sphere.
  110. </p>
  111. <h2>源代码</h2>
  112. <p>
  113. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  114. </p>
  115. </body>
  116. </html>