Skip to content

Commit 44bb828

Browse files
committed
Merge branch 'dev' of https://github.com/TatumCreative/three.js into dev
Conflicts: docs/api/math/Box3.html
2 parents 5a8a618 + 9f4693c commit 44bb828

File tree

3 files changed

+106
-68
lines changed

3 files changed

+106
-68
lines changed

docs/api/math/Box2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ <h3>.distanceToPoint([page:Vector2 point]) [page:Float]</h3>
212212

213213
<h3>.containsPoint([page:Vector2 point]) [page:Boolean]</h3>
214214
<div>
215-
point -- Point to check for inclusion.
215+
point -- [page:Vector2] to check for inclusion.
216216
</div>
217217
<div>
218218
Returns true if the specified point lies within the boundaries of this box.

docs/api/math/Box3.html

Lines changed: 103 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ <h2>Constructor</h2>
1717

1818
<h3>[name]([page:Vector3 min], [page:Vector3 max])</h3>
1919
<div>
20-
min -- Lower (x, y, z) boundary of the box. <br />
20+
min -- Lower (x, y, z) boundary of the box.<br />
2121
max -- Upper (x, y, z) boundary of the box.
2222
</div>
2323
<div>
24-
Creates a box bounded by min and max
24+
Creates a box bounded by min and max.
2525
</div>
2626

2727
<h2>Properties</h2>
@@ -36,121 +36,142 @@ <h3>.[page:Vector3 max]</h3>
3636
<h3>.[page:Vector3 min]</h3>
3737
<div>
3838
Lower (x, y, z) boundary of this box.
39-
</div>
39+
</div>
4040

4141
<h2>Methods</h2>
4242

4343

4444

4545
<h3>.set([page:Vector3 min], [page:Vector3 max]) [page:Box3 this]</h3>
4646
<div>
47-
min -- Upper (x, y, z) boundary of this box. <br />
48-
max -- Lower (x, y, z) boundary of this box.
47+
min -- Lower (x, y, z) boundary of the box. <br />
48+
max -- Upper (x, y, z) boundary of the box.
4949
</div>
5050
<div>
5151
Sets the lower and upper (x, y, z) boundaries of this box.
5252
</div>
53-
54-
<h3>.applyMatrix4([page:Matrix4 matrix]) [page:Box3 this]</h3>
53+
54+
<h3>.addPoint([page:Vector3 point]) [page:Box3 this]</h3>
5555
<div>
56-
matrix -- [page:Matrix4].
56+
point -- [page:Vector3] to add to the box <br />
5757
</div>
5858
<div>
59-
Transform the box with a Matrix4.
59+
If the *point* is outside the bounds of the box, the bounds are expanded
60+
so that the point is within the bounds.
61+
</div>
62+
63+
<h3>.applyMatrix4([page:Matrix4 matrix]) [page:Box3 this]</h3>
64+
<div>
65+
matrix -- The [page:Matrix4] to apply
6066
</div>
61-
62-
<h3>.expandByPoint([page:Vector3 point]) [page:Box3 this]</h3>
6367
<div>
64-
Expands the box outwards by the point. It takes the min and max values of the box.
68+
Transforms this Box3 with the supplied matrix.
6569
</div>
6670

6771
<h3>.clampPoint([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
6872
<div>
69-
point -- [page:Vector3] <br />
70-
optionalTarget -- [page:Vector3] An optional target point.
73+
point -- Position to clamp. <br />
74+
optionalTarget -- If specified, the clamped result will be copied here.
7175
</div>
7276
<div>
73-
Clamp a point within the min and max boundaries of the box. Returns either a new point or the modified passed target.
77+
Clamps *point* within the bounds of this box.
7478
</div>
7579

7680
<h3>.isIntersectionBox([page:Box3 box]) [page:Boolean]</h3>
7781
<div>
78-
box -- [page:Box3]
82+
box -- Box to check for intersection against.
7983
</div>
8084
<div>
81-
Return whether or not the passed box intersects with this Box3.
85+
Determines whether or not this box intersects *box*.
8286
</div>
8387

84-
<h3>.setFromPoints([page:Array points])</h3>
88+
<h3>.setFromPoints([page:Array points]) [page:Box3 this]</h3>
8589
<div>
86-
points -- [page:Array] of [page:Vector3] points
90+
points -- Set of points that the resulting box will envelop.
8791
</div>
8892
<div>
89-
Sets this box to the min value and max value of all the points in the array. If the array is empty, then it sets the box as empty.
93+
Sets the upper and lower bounds of this box to include all of the points in *points*.
9094
</div>
91-
92-
<h3>.size([page:Vector3 optionalTarget]) [page:Vector3]</h3>
95+
96+
<h3>.setFromObject([page:Object3D object]) [page:Box3 this]</h3>
9397
<div>
94-
optionalTarget -- [page:Vector3] (optional)
98+
object -- [page:Object3D] to compute the bounding box for.
9599
</div>
96100
<div>
97-
Returns either a new Vector3 or the target Vector3 that represents the size of the box from the min point to max point.
101+
Computes the world-axis-aligned bounding box of an object (including its children),
102+
accounting for both the object's, and childrens', world transforms
98103
</div>
104+
105+
99106

100-
<h3>.union([page:Box3 box]) [page:Box3 this]</h3>
107+
<h3>.size([page:Vector3 optionalTarget]) [page:Vector3]</h3>
101108
<div>
102-
box -- [page:Box3]
109+
optionalTarget -- If specified, the result will be copied here.
103110
</div>
104111
<div>
105-
Sets the box's min and max boundaries to union of the two boxes.
112+
Returns the width, height, and depth of this box.
106113
</div>
107114

108-
<h3>.getParameter([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
115+
<h3>.union([page:Box3 box]) [page:Box3]</h3>
109116
<div>
110-
point -- [page:Vector3]<br/>
111-
optionalTarget -- [page:Vector3]
117+
box -- Box that will be unioned with this box.
112118
</div>
113119
<div>
114-
Returns a point as a proportion of this box's width, height, and depth. If the point is contained by the box the x, y, and z of the returned vector will be between 0 and 1.
120+
Unions this box with *box* setting the upper bound of this box to the greater of the
121+
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes'
122+
lower bounds.
115123
</div>
116124

117-
<h3>.expandByScalar([page:Float scalar]) [page:Box3 this]</h3>
125+
<h3>.getParameter([page:Vector3 point], [page:Vector3 optionalTarget]) [page:Vector3]</h3>
118126
<div>
119-
scalar -- [page:Float] representing the distance to expand
127+
point -- Point to parametrize.
128+
optionalTarget -- If specified, the result will be copied here.
120129
</div>
121130
<div>
122-
Expands or contracts the box by adding the scalar value to the box's min and max vectors.
131+
Returns point as a proportion of this box's width and height.
123132
</div>
124133

125134
<h3>.intersect([page:Box3 box]) [page:Box3 this]</h3>
126135
<div>
127-
box -- [page:Box3]
136+
box -- Box to intersect with.
128137
</div>
129138
<div>
130-
Returns the intersection of the two boxes, setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds.
131-
139+
Returns the intersection of this and *box*, setting the upper bound of this box to the lesser </br>
140+
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' </br>
141+
lower bounds.
132142
</div>
133143

134144
<h3>.containsBox([page:Box3 box]) [page:Boolean]</h3>
135145
<div>
136-
box -- [page:Box3]
146+
box -- Box to test for inclusion.
137147
</div>
138148
<div>
139-
Returns true if this box includes the entirety of box. If this and box overlap exactly, this function also returns true.
140-
149+
Returns true if this box includes the entirety of *box*. If this and *box* overlap exactly,</br>
150+
this function also returns true.
141151
</div>
142152

153+
<h3>.containsPoint([page:Vector3 point]) [page:Boolean]</h3>
154+
<div>
155+
point -- [page:Vector3] to check for inclusion.
156+
</div>
157+
<div>
158+
Returns true if the specified point lies within the boundaries of this box.
159+
</div>
160+
143161
<h3>.translate([page:Vector3 offset]) [page:Box3 this]</h3>
144162
<div>
145-
offset -- [page:Vector3]
163+
offset -- Direction and distance of offset.
146164
</div>
147165
<div>
148-
Translates the box the distance of the offset.
166+
Adds *offset* to both the upper and lower bounds of this box, effectively moving this box </br>
167+
*offset* units in 3D space.
149168
</div>
150169

151170
<h3>.empty() [page:Boolean]</h3>
152171
<div>
153-
Checks to see if the box is empty. If the lower and upper bounds of the box are equal, this function still returns false as the box would still contain one point.
172+
Returns true if this box includes zero points within its bounds.</br>
173+
Note that a box with equal lower and upper bounds still includes one point, the
174+
one both bounds share.
154175
</div>
155176

156177
<h3>.clone() [page:Box3]</h3>
@@ -160,72 +181,87 @@ <h3>.clone() [page:Box3]</h3>
160181

161182
<h3>.equals([page:Box3 box]) [page:Boolean]</h3>
162183
<div>
163-
box -- [page:Box3]
184+
box -- Box to compare.
164185
</div>
165186
<div>
166-
Returns true if the boes share the same lower and upper bounds.
187+
Returns true if this box and *box* share the same lower and upper bounds.
167188
</div>
168189

190+
<h3>.expandByPoint([page:Vector3 point]) [page:Box3 this]</h3>
191+
<div>
192+
point -- Point that should be included in the box.
193+
</div>
194+
<div>
195+
Expands the boundaries of this box to include *point*.
196+
</div>
197+
198+
<h3>.expandByScalar([page:float scalar]) [page:Box3 this]</h3>
199+
<div>
200+
scalar -- Distance to expand.
201+
</div>
202+
<div>
203+
Expands each dimension of the box by *scalar*. If negative, the dimensions of the box <br/>
204+
will be contracted.
205+
</div>
206+
169207
<h3>.expandByVector([page:Vector3 vector]) [page:Box3 this]</h3>
170208
<div>
171-
vector -- [page:Vector3] representing the amount to expand this box in each dimension.
209+
vector -- Amount to expand this box in each dimension.
172210
</div>
173211
<div>
174-
Adds the passed vector to the upper boundary, and subtracts it from the lower boundary.
212+
Expands this box equilaterally by *vector*. The width of this box will be
213+
expanded by the x component of *vector* in both directions. The height of
214+
this box will be expanded by the y component of *vector* in both directions.
215+
The depth of this box will be expanded by the z component of *vector* in
216+
both directions.
175217
</div>
176218

177219
<h3>.copy([page:Box3 box]) [page:Box3 this]</h3>
178220
<div>
179-
box -- [page:Box3] to copy.
221+
box -- Box to copy.
180222
</div>
181223
<div>
182-
Copies the values of the passed box to this box.
224+
Copies the values of *box* to this box.
183225
</div>
184226

185227
<h3>.makeEmpty() [page:Box3 this]</h3>
186228
<div>
187-
Makes this box empty so that it cannot contain any points.
229+
Makes this box empty.
188230
</div>
189231

190232
<h3>.center([page:Vector3 optionalTarget]) [page:Vector3]</h3>
191233
<div>
192-
optionalTarget -- [page:Vector3] If specified, the result will be copied here.
234+
optionalTarget -- If specified, the result will be copied here.
193235
</div>
194236
<div>
195-
Returns the center point of this box.
237+
Returns the center point of this box.
196238
</div>
197239

198240
<h3>.getBoundingSphere([page:Sphere optionalTarget]) [page:Sphere]</h3>
199241
<div>
200-
optionalTarget -- [page:Sphere]
242+
optionalTarget -- [page:Sphere] to optionally set the result to.
201243
</div>
202244
<div>
203-
Returns a bounding sphere.
245+
Gets a sphere that bounds the box.
204246
</div>
205247

206248
<h3>.distanceToPoint([page:Vector3 point]) [page:Float]</h3>
207249
<div>
208-
point -- [page:Vector3]
250+
point -- Point to measure distance to.
209251
</div>
210252
<div>
211-
Returns the distance from any edge of this box to the specified point. If the point lies inside of this box, the distance will be 0.
212-
</div>
213-
214-
<h3>.containsPoint([page:Vector3 point]) [page:Boolean]</h3>
215-
<div>
216-
point -- [page:Vector3]
217-
</div>
218-
<div>
219-
Returns true if the specified point lies within the boundaries of this box.
253+
Returns the distance from any edge of this box to the specified point. </br>
254+
If the point lies inside of this box, the distance will be 0.
220255
</div>
221256

222257
<h3>.setFromCenterAndSize([page:Vector3 center], [page:Vector3 size]) [page:Box3 this]</h3>
223258
<div>
224-
center -- [page:Vector3] representing the center position.<br />
225-
size -- [page:Vector3] representing the dimensions of the box.
259+
center -- Desired center position of the box. <br />
260+
size -- Desired x and y dimensions of the box.
226261
</div>
227262
<div>
228-
Sets this box based on a center vector, and width, height, and depth vector.
263+
Centers this box on *center* and sets this box's width and height to the values specified
264+
in *size*.
229265
</div>
230266

231267
<h2>Source</h2>

src/math/Box3.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ THREE.Box3.prototype = {
5454
this.max.z = point.z;
5555

5656
}
57+
58+
return this;
5759

5860
},
5961

0 commit comments

Comments
 (0)