Doodle3D-Slicer/three.js-master/docs/api/math/Box2.html
2017-06-22 13:21:07 +02:00

236 lines
6.2 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<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])</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 isIntersectionBox]([page:Box2 box])</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 size]([page:Vector2 optionalTarget])</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])</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])</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 empty]()</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]()</h3>
<div>
Returns a copy of this box.
</div>
<h3>[method:Boolean equals]([page:Box2 box])</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 center]([page:Vector2 optionalTarget])</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])</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])</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>