Sphere.html 3.6 KB

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