123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <div class="desc">Represents a boundary box in 2D space.</div>
- <h2>Constructor</h2>
- <h3>[name]( [page:Vector2 min], [page:Vector2 max] )</h3>
- <div>
- min -- Lower (x, y) boundary of the box.<br />
- max -- Upper (x, y) boundary of the box.
- </div>
- <div>
- Creates a box bounded by min and max.
- </div>
- <h2>Properties</h2>
- <h3>[property:Vector2 min]</h3>
- <div>
- Lower (x, y) boundary of this box.
- </div>
- <h3>[property:Vector2 max]</h3>
- <div>
- Upper (x, y) boundary of this box.
- </div>
- <h2>Methods</h2>
- <h3>[method:Box2 set]( [page:Vector2 min], [page:Vector2 max] ) [page:Box2 this]</h3>
- <div>
- min -- Lower (x, y) boundary of the box. <br />
- max -- Upper (x, y) boundary of the box.
- </div>
- <div>
- Sets the lower and upper (x, y) boundaries of this box.
- </div>
- <h3>[method:Box2 expandByPoint]( [page:Vector2 point] ) [page:Box2 this]</h3>
- <div>
- point -- Point that should be included in the box.
- </div>
- <div>
- Expands the boundaries of this box to include *point*.
- </div>
- <h3>[method:Vector2 clampPoint]( [page:Vector2 point], [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
- <div>
- point -- Position to clamp. <br />
- optionalTarget -- If specified, the clamped result will be copied here.
- </div>
- <div>
- Clamps *point* within the bounds of this box.
- </div>
- <h3>[method:Boolean intersectsBox]( [page:Box2 box] ) [page:Box2 this]</h3>
- <div>
- box -- Box to check for intersection against.
- </div>
- <div>
- Determines whether or not this box intersects *box*.
- </div>
- <h3>[method:Box2 setFromPoints]( [page:Array points] ) [page:Box2 this]</h3>
- <div>
- points -- Set of points that the resulting box will envelop.
- </div>
- <div>
- Sets the upper and lower bounds of this box to include all of the points in *points*.
- </div>
- <h3>[method:Vector2 getSize]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
- <div>
- optionalTarget -- If specified, the result will be copied here.
- </div>
- <div>
- Returns the width and height of this box.
- </div>
- <h3>[method:Box2 union]( [page:Box2 box] ) [page:Box2 this]</h3>
- <div>
- box -- Box that will be unioned with this box.
- </div>
- <div>
- Unions this box with *box* setting the upper bound of this box to the greater of the
- two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes'
- lower bounds.
- </div>
- <h3>[method:Vector2 getParameter]( [page:Vector2 point], [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
- <div>
- point -- [page:Vector2]<br/>
- optionalTarget -- [page:Vector2]<br/>
- </div>
- <div>
- Returns a point as a proportion of this box's width and height.
- </div>
- <h3>[method:Box2 expandByScalar]( [page:float scalar] ) [page:Box2 this]</h3>
- <div>
- scalar -- Distance to expand.
- </div>
- <div>
- Expands each dimension of the box by *scalar*. If negative, the dimensions of the box </br>
- will be contracted.
- </div>
- <h3>[method:Box2 intersect]( [page:Box2 box] ) [page:Box2 this]</h3>
- <div>
- box -- Box to intersect with.
- </div>
- <div>
- Returns the intersection of this and *box*, setting the upper bound of this box to the lesser </br>
- of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' </br>
- lower bounds.
- </div>
- <h3>[method:Boolean containsBox]( [page:Box2 box] ) [page:Box2 this]</h3>
- <div>
- box -- Box to test for inclusion.
- </div>
- <div>
- Returns true if this box includes the entirety of *box*. If this and *box* overlap exactly,</br>
- this function also returns true.
- </div>
- <h3>[method:Box2 translate]( [page:Vector2 offset] ) [page:Box2 this]</h3>
- <div>
- offset -- Direction and distance of offset.
- </div>
- <div>
- Adds *offset* to both the upper and lower bounds of this box, effectively moving this box </br>
- *offset* units in 2D space.
- </div>
- <h3>[method:Boolean isEmpty]() [page:Box2 this]</h3>
- <div>
- Returns true if this box includes zero points within its bounds.</br>
- Note that a box with equal lower and upper bounds still includes one point, the
- one both bounds share.
- </div>
- <h3>[method:Box2 clone]() [page:Box2 this]</h3>
- <div>
- Returns a copy of this box.
- </div>
- <h3>[method:Boolean equals]( [page:Box2 box] ) [page:Box2 this]</h3>
- <div>
- box -- Box to compare.
- </div>
- <div>
- Returns true if this box and *box* share the same lower and upper bounds.
- </div>
- <h3>[method:Box2 expandByVector]( [page:Vector2 vector] ) [page:Box2 this]</h3>
- <div>
- vector -- Amount to expand this box in each dimension.
- </div>
- <div>
- Expands this box equilaterally by *vector*. The width of this box will be
- expanded by the x component of *vector* in both directions. The height of
- this box will be expanded by the y component of *vector* in both directions.
- </div>
- <h3>[method:Box2 copy]( [page:Box2 box] ) [page:Box2 this]</h3>
- <div>
- box -- Box to copy.
- </div>
- <div>
- Copies the values of *box* to this box.
- </div>
- <h3>[method:Box2 makeEmpty]() [page:Box2 this]</h3>
- <div>
- Makes this box empty.
- </div>
- <h3>[method:Vector2 getCenter]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3>
- <div>
- optionalTarget -- If specified, the result will be copied here.
- </div>
- <div>
- Returns the center point of this box.
- </div>
- <h3>[method:Float distanceToPoint]( [page:Vector2 point] ) [page:Box2 this]</h3>
- <div>
- point -- Point to measure distance to.
- </div>
- <div>
- Returns the distance from any edge of this box to the specified point. </br>
- If the point lies inside of this box, the distance will be 0.
- </div>
- <h3>[method:Boolean containsPoint]( [page:Vector2 point] ) [page:Box2 this]</h3>
- <div>
- point -- [page:Vector2] to check for inclusion.
- </div>
- <div>
- Returns true if the specified point lies within the boundaries of this box.
- </div>
- <h3>[method:Box2 setFromCenterAndSize]( [page:Vector2 center], [page:Vector2 size] ) [page:Box2 this]</h3>
- <div>
- center -- Desired center position of the box. <br />
- size -- Desired x and y dimensions of the box.
- </div>
- <div>
- Centers this box on *center* and sets this box's width and height to the values specified
- in *size*.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|