Box3.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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">Represents a boundary box in 3d space.</div>
  13. <h2>Constructor</h2>
  14. <h3>[name]( [page:Vector3 min], [page:Vector3 max] )</h3>
  15. <div>
  16. min -- Lower (x, y, z) boundary of the box.<br>
  17. max -- Upper (x, y, z) boundary of the box.
  18. </div>
  19. <div>
  20. Creates a box bounded by min and max.
  21. </div>
  22. <h2>Properties</h2>
  23. <h3>[property:Vector3 min]</h3>
  24. <div>
  25. Lower (x, y, z) boundary of this box.
  26. </div>
  27. <h3>[property:Vector3 max]</h3>
  28. <div>
  29. Upper (x, y, z) boundary of this box.
  30. </div>
  31. <h2>Methods</h2>
  32. <h3>[method:Box3 set]( [page:Vector3 min], [page:Vector3 max] ) [page:Box3 this]</h3>
  33. <div>
  34. min -- Lower (x, y, z) boundary of the box. <br>
  35. max -- Upper (x, y, z) boundary of the box.
  36. </div>
  37. <div>
  38. Sets the lower and upper (x, y, z) boundaries of this box.
  39. </div>
  40. <h3>[method:Box3 applyMatrix4]( [page:Matrix4 matrix] ) [page:Box3 this]</h3>
  41. <div>
  42. matrix -- The [page:Matrix4] to apply
  43. </div>
  44. <div>
  45. Transforms this Box3 with the supplied matrix.
  46. </div>
  47. <h3>[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
  48. <div>
  49. point -- Position to clamp. <br>
  50. optionalTarget -- If specified, the clamped result will be copied here.
  51. </div>
  52. <div>
  53. Clamps *point* within the bounds of this box.
  54. </div>
  55. <h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Box3 this]</h3>
  56. <div>
  57. box -- Box to check for intersection against.
  58. </div>
  59. <div>
  60. Determines whether or not this box intersects *box*.
  61. </div>
  62. <h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] ) [page:Box3 this]</h3>
  63. <div>
  64. sphere -- Sphere to check for intersection against.
  65. </div>
  66. <div>
  67. Determines whether or not this box intersects *sphere*.
  68. </div>
  69. <h3>[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Box3 this]</h3>
  70. <div>
  71. plane -- Plane to check for intersection against.
  72. </div>
  73. <div>
  74. Determines whether or not this box intersects *plane*.
  75. </div>
  76. <h3>[method:Box3 setFromPoints]( [page:Array points] ) [page:Box3 this]</h3>
  77. <div>
  78. points -- Set of points that the resulting box will envelop.
  79. </div>
  80. <div>
  81. Sets the upper and lower bounds of this box to include all of the points in *points*.
  82. </div>
  83. <h3>[method:Box3 setFromObject]( [page:Object3D object] ) [page:Box3 this]</h3>
  84. <div>
  85. object -- [page:Object3D] to compute the bounding box for.
  86. </div>
  87. <div>
  88. Computes the world-axis-aligned bounding box of an object (including its children), <br>
  89. accounting for both the object's, and childrens', world transforms
  90. </div>
  91. <h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
  92. <div>
  93. optionalTarget -- If specified, the result will be copied here.
  94. </div>
  95. <div>
  96. Returns the width, height, and depth of this box.
  97. </div>
  98. <h3>[method:Box3 union]( [page:Box3 box] ) [page:Box3 this]</h3>
  99. <div>
  100. box -- Box that will be unioned with this box.
  101. </div>
  102. <div>
  103. Unions this box with *box* setting the upper bound of this box to the greater of the <br>
  104. two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' <br>
  105. lower bounds.
  106. </div>
  107. <h3>[method:Vector3 getParameter]( [page:Vector3 point], [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
  108. <div>
  109. point -- Point to parametrize.
  110. optionalTarget -- If specified, the result will be copied here.
  111. </div>
  112. <div>
  113. Returns point as a proportion of this box's width and height.
  114. </div>
  115. <h3>[method:Box3 intersect]( [page:Box3 box] ) [page:Box3 this]</h3>
  116. <div>
  117. box -- Box to intersect with.
  118. </div>
  119. <div>
  120. Returns the intersection of this and *box*, setting the upper bound of this box to the lesser <br>
  121. of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' <br>
  122. lower bounds.
  123. </div>
  124. <h3>[method:Boolean containsBox]( [page:Box3 box] ) [page:Box3 this]</h3>
  125. <div>
  126. box -- Box to test for inclusion.
  127. </div>
  128. <div>
  129. Returns true if this box includes the entirety of *box*. If this and *box* overlap exactly,<br>
  130. this function also returns true.
  131. </div>
  132. <h3>[method:Boolean containsPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
  133. <div>
  134. point -- [page:Vector3] to check for inclusion.
  135. </div>
  136. <div>
  137. Returns true if the specified point lies within the boundaries of this box.
  138. </div>
  139. <h3>[method:Box3 translate]( [page:Vector3 offset] ) [page:Box3 this]</h3>
  140. <div>
  141. offset -- Direction and distance of offset.
  142. </div>
  143. <div>
  144. Adds *offset* to both the upper and lower bounds of this box, effectively moving this box <br>
  145. *offset* units in 3D space.
  146. </div>
  147. <h3>[method:Boolean isEmpty]() [page:Box3 this]</h3>
  148. <div>
  149. Returns true if this box includes zero points within its bounds.<br>
  150. Note that a box with equal lower and upper bounds still includes one point, the <br>
  151. one both bounds share.
  152. </div>
  153. <h3>[method:Box3 clone]() [page:Box3 this]</h3>
  154. <div>
  155. Returns a copy of this box.
  156. </div>
  157. <h3>[method:Boolean equals]( [page:Box3 box] ) [page:Box3 this]</h3>
  158. <div>
  159. box -- Box to compare.
  160. </div>
  161. <div>
  162. Returns true if this box and *box* share the same lower and upper bounds.
  163. </div>
  164. <h3>[method:Box3 expandByPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
  165. <div>
  166. point -- Point that should be included in the box.
  167. </div>
  168. <div>
  169. Expands the boundaries of this box to include *point*.
  170. </div>
  171. <h3>[method:Box3 expandByScalar]( [page:float scalar] ) [page:Box3 this]</h3>
  172. <div>
  173. scalar -- Distance to expand.
  174. </div>
  175. <div>
  176. Expands each dimension of the box by *scalar*. If negative, the dimensions of the box <br/>
  177. will be contracted.
  178. </div>
  179. <h3>[method:Box3 expandByVector]( [page:Vector3 vector] ) [page:Box3 this]</h3>
  180. <div>
  181. vector -- Amount to expand this box in each dimension.
  182. </div>
  183. <div>
  184. Expands this box equilaterally by *vector*. The width of this box will be <br>
  185. expanded by the x component of *vector* in both directions. The height of <br>
  186. this box will be expanded by the y component of *vector* in both directions. <br>
  187. The depth of this box will be expanded by the z component of *vector* in <br>
  188. both directions.
  189. </div>
  190. <h3>[method:Box3 copy]( [page:Box3 box] ) [page:Box3 this]</h3>
  191. <div>
  192. box -- Box to copy.
  193. </div>
  194. <div>
  195. Copies the values of *box* to this box.
  196. </div>
  197. <h3>[method:Box3 makeEmpty]() [page:Box3 this]</h3>
  198. <div>
  199. Makes this box empty.
  200. </div>
  201. <h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
  202. <div>
  203. optionalTarget -- If specified, the result will be copied here.
  204. </div>
  205. <div>
  206. Returns the center point of this box.
  207. </div>
  208. <h3>[method:Sphere getBoundingSphere]( [page:Sphere optionalTarget] ) [page:Box3 this]</h3>
  209. <div>
  210. optionalTarget -- [page:Sphere] to optionally set the result to.
  211. </div>
  212. <div>
  213. Gets a sphere that bounds the box.
  214. </div>
  215. <h3>[method:Float distanceToPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
  216. <div>
  217. point -- Point to measure distance to.
  218. </div>
  219. <div>
  220. Returns the distance from any edge of this box to the specified point. <br>
  221. If the point lies inside of this box, the distance will be 0.
  222. </div>
  223. <h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] ) [page:Box3 this]</h3>
  224. <div>
  225. center -- Desired center position of the box. <br>
  226. size -- Desired x, y and z dimensions of the box.
  227. </div>
  228. <div>
  229. Centers this box on *center* and sets this box's width, height and depth to the values specified <br>
  230. in *size*.
  231. </div>
  232. <h2>Source</h2>
  233. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  234. </body>
  235. </html>