forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBox2.html
More file actions
233 lines (195 loc) · 5.94 KB
/
Copy pathBox2.html
File metadata and controls
233 lines (195 loc) · 5.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!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>.[page:Vector2 max]</h3>
<div>
Upper (x, y) boundary of this box.
</div>
<h3>.[page:Vector2 min]</h3>
<div>
Lower (x, y) boundary of this box.
</div>
<h2>Methods</h2>
<h3>.set([page:Vector2 min], [page:Vector2 max]) [page:todo]</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>.expandByPoint([page:Vector2 point]) [page:Box2]</h3>
<div>
point -- Point that should be included in the box.
</div>
<div>
Expands the boundaries of this box to include *point*.
</div>
<h3>.clampPoint([page:Vector2 point], [page:Vector2 optionalTarget]) [page:Vector2]</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>.isIntersectionBox([page:Box2 box]) [page:Boolean]</h3>
<div>
box -- Box to check for intersection against.
</div>
<div>
Determines whether or not this box intersects *box*.
</div>
<h3>.setFromPoints([page:Array points]) [page:Box2]</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>.size([page:Vector2 optionalTarget]) [page:Vector2]</h3>
<div>
optionalTarget -- If specified, the result will be copied here.
</div>
<div>
Returns the width and height of this box.
</div>
<h3>.union([page:Box2 box]) [page:Box2]</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>.getParameter([page:Vector2 point]) [page:Vector2]</h3>
<div>
point -- Point to parametrize.
</div>
<div>
Returns point as a proportion of this box's width and height.
</div>
<h3>.expandByScalar([page:float scalar]) [page:Box2]</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>.intersect([page:Box2 box]) [page:Box2]</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>.containsBox([page:Box2 box]) [page:Boolean]</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>.translate([page:Vector2 offset]) [page:Box2]</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>.empty() [page:Boolean]</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>.clone() [page:Box2]</h3>
<div>
Returns a copy of this box.
</div>
<h3>.equals([page:Box2 box]) [page:Boolean]</h3>
<div>
box -- Box to compare.
</div>
<div>
Returns true if this box and *box* share the same lower and upper bounds.
</div>
<h3>.expandByVector([page:Vector2 vector]) [page:Box2]</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>.copy([page:Box2 box]) [page:Box2]</h3>
<div>
box -- Box to copy.
</div>
<div>
Copies the values of *box* to this box.
</div>
<h3>.makeEmpty() [page:Box2]</h3>
<div>
Makes this box empty.
</div>
<h3>.center([page:Vector2 optionalTarget]) [page:Vector2]</h3>
<div>
optionalTarget -- If specified, the result will be copied here.
</div>
<div>
Returns the center point of this box.
</div>
<h3>.distanceToPoint([page:Vector2 point]) [page:Float]</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>.containsPoint([page:Vector2 point]) [page:Boolean]</h3>
<div>
point -- Point to check for inclusion.
</div>
<div>
Returns true if the specified point lies within the boundaries of this box.
</div>
<h3>.setFromCenterAndSize([page:Vector2 center], [page:Vector2 size]) [page:Box2]</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>