2
0

Sphere.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 sphere defined by a center position and radius.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]([page:Vector3 center], [page:Float radius])</h3>
  14. <div>
  15. center -- [page:Vector3] <br />
  16. radius -- [page:Float]
  17. </div>
  18. <h2>Properties</h2>
  19. <h3>[property:Vector3 center]</h3>
  20. <h3>[property:Float radius]</h3>
  21. <h2>Methods</h2>
  22. <h3>.set([page:Vector3 center], [page:Float radius]) [page:this:Sphere]</h3>
  23. <div>
  24. center -- [page:Vector3] <br />
  25. radius -- [page:Float]
  26. </div>
  27. <div>
  28. Sets the center and radius.
  29. </div>
  30. <h3>[method:Sphere applyMatrix4]([page:Matrix4 matrix]) [page:Sphere this]</h3>
  31. <div>
  32. matrix -- [page:Matrix4]
  33. </div>
  34. <div>
  35. Transforms this sphere with the provided [page:Matrix4].
  36. </div>
  37. <h3>[method:Vector3 clampPoint]([page:Vector3 point], [page:Vector3 optionalTarget])</h3>
  38. <div>
  39. point -- [page:Vector3] The point to clamp <br />
  40. optionalTarget -- [page:Vector3] The optional target point to return
  41. </div>
  42. <div>
  43. Clamps a point within the sphere. If the point is is outside the sphere, it will clamp it to the closets point on the edge of the sphere.
  44. </div>
  45. <h3>[method:Sphere translate]([page:Vector3 offset]) [page:Sphere this]</h3>
  46. <div>
  47. offset -- [page:Vector3]
  48. </div>
  49. <div>
  50. Translate the sphere's center by the provided offset vector.
  51. </div>
  52. <h3>[method:Sphere clone]()</h3>
  53. <div>
  54. Provides a new copy of the sphere.
  55. </div>
  56. <h3>[method:Boolean equals]([page:Sphere sphere])</h3>
  57. <div>
  58. sphere -- [page:Sphere]
  59. </div>
  60. <div>
  61. Checks to see if the two spheres' centers and radii are equal.
  62. </div>
  63. <h3>[method:Sphere setFromPoints]([page:Array points], [page:Vector3 optionalCenter]) [page:Sphere this]</h3>
  64. <div>
  65. points -- [page:Array] of [page:Vector3] positions.<br />
  66. optionalCenter -- Optional [page:Vector3] position for the sphere's center.<br />
  67. </div>
  68. <div>
  69. Computes the minimum bounding sphere for *points*. If *optionalCenter* is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing *points* is calculated.
  70. </div>
  71. <h3>[method:Float distanceToPoint]([page:Vector3 point])</h3>
  72. <div>
  73. point -- [page:Vector3]
  74. </div>
  75. <div>
  76. Returns the closest distance from the boundary of the sphere to the point. If the sphere contains the point, the distance will be negative.
  77. </div>
  78. <h3>[method:Box getBoundingBox]([page:Box optionalTarget])</h3>
  79. <div>
  80. optionalTarget -- [page:Box]
  81. </div>
  82. <div>
  83. Returns a bounding box for the sphere, optionally setting a provided box target.
  84. </div>
  85. <h3>[method:Boolean containsPoint]([page:Vector3 point])</h3>
  86. <div>
  87. point -- [page:Vector3]
  88. </div>
  89. <div>
  90. Checks to see if the sphere contains the provided point inclusive of the edge of the sphere.
  91. </div>
  92. <h3>[method:Sphere copy]([page:Sphere sphere])</h3>
  93. <div>
  94. sphere -- [page:Sphere] to copy
  95. </div>
  96. <div>
  97. Copies the values of the passed sphere to this sphere.
  98. </div>
  99. <h3>[method:Boolean intersectsSphere]([page:Sphere sphere])</h3>
  100. <div>
  101. sphere -- [page:Sphere]
  102. </div>
  103. <div>
  104. Checks to see if two spheres intersect.
  105. </div>
  106. <h3>[method:Boolean empty]()</h3>
  107. <div>
  108. Checks to see if the sphere is empty (the radius set to 0).
  109. </div>
  110. <h2>Source</h2>
  111. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  112. </body>
  113. </html>