Răsfoiți Sursa

Updated Box3 doc

looeee 8 ani în urmă
părinte
comite
b403dd87bd
2 a modificat fișierele cu 159 adăugiri și 165 ștergeri
  1. 12 9
      docs/api/math/Box2.html
  2. 147 156
      docs/api/math/Box3.html

+ 12 - 9
docs/api/math/Box2.html

@@ -10,7 +10,10 @@
 	<body>
 		<h1>[name]</h1>
 
-		<div class="desc">Represents a boundary box in 2D space.</div>
+		<div class="desc">
+			Represents a [link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box]
+			in 2D space.
+		</div>
 
 
 		<h2>Constructor</h2>
@@ -53,7 +56,7 @@
 		[page:Vector2 point] - [page:Vector2] to clamp. <br>
 		[page:Vector2 optionalTarget] - If specified, the clamped result will be copied into this [page:Vector2].<br /><br />
 
-		[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the *point* within the bounds of this box.<br />
+		[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the [page:Vector2 point] within the bounds of this box.<br />
 		Note: if [page:Vector2 optionalTarget] is not specified, a new [page:Vector2] will be returned. The original point
 		is not modified.
 		</div>
@@ -91,6 +94,13 @@
 		If the [page:Vector2 point] lies inside of this box, the distance will be 0.
 		</div>
 
+		<h3>[method:Boolean equals]( [page:Box2 box] )</h3>
+		<div>
+		[page:Box2 box] - Box to compare with this one.<br /><br />
+
+		Returns true if this box and [page:Box2 box] share the same lower and upper bounds.
+		</div>
+
 		<h3>[method:Box2 expandByPoint]( [page:Vector2 point] )</h3>
 		<div>
 		[page:Vector2 point] - [page:Vector2] that should be included in the box.<br /><br />
@@ -140,13 +150,6 @@
 		a new [page:Vector2] containing the result will be returned.
 		</div>
 
-		<h3>[method:Boolean equals]( [page:Box2 box] )</h3>
-		<div>
-		[page:Box2 box] - Box to compare with this one.<br /><br />
-
-		Returns true if this box and [page:Box2 box] share the same lower and upper bounds.
-		</div>
-
 		<h3>[method:Box2 intersect]( [page:Box2 box] )</h3>
 		<div>
 		[page:Box2 box] - Box to intersect with.<br /><br />

+ 147 - 156
docs/api/math/Box3.html

@@ -10,266 +10,257 @@
 	<body>
 		<h1>[name]</h1>
 
-		<div class="desc">Represents a boundary box in 3d space.</div>
+		<div class="desc">
+			Represents a [link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box]
+			in 3D space.
+		</div>
 
 
 		<h2>Constructor</h2>
 
 
 		<h3>[name]( [page:Vector3 min], [page:Vector3 max] )</h3>
-		<div>
-		min -- Lower (x, y, z) boundary of the box.<br>
-		max -- Upper (x, y, z) boundary of the box.
-		</div>
-		<div>
+		[page:Vector3 min] - (optional) [page:Vector3] representing the lower (x, y, z) boundary of the box.
+		Default is ( + Infinity, + Infinity, + Infinity ).<br>
+
+		[page:Vector3 max] - (optional) [page:Vector3] representing the lower upper (x, y, z) boundary of the box.
+		Default is ( - Infinity, - Infinity, - Infinity ).<br /><br />
+
 		Creates a box bounded by min and max.
 		</div>
 
 		<h2>Properties</h2>
 
+		<h3>[property:Boolean isBox3]</h3>
+		<div>
+			Used to check whether this or derived classes are Box3s. Default is *true*.<br /><br />
 
+			You should not change this, as it used internally for optimisation.
+		</div>
 
 		<h3>[property:Vector3 min]</h3>
 		<div>
-		Lower (x, y, z) boundary of this box.
+			[page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
+			Default is ( + Infinity, + Infinity, + Infinity ).
 		</div>
 
 		<h3>[property:Vector3 max]</h3>
 		<div>
-		Upper (x, y, z) boundary of this box.
+			[page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br />
+			Default is ( - Infinity, - Infinity, - Infinity ).
 		</div>
 
-		<h2>Methods</h2>
 
 
+		<h2>Methods</h2>
 
-		<h3>[method:Box3 set]( [page:Vector3 min], [page:Vector3 max] ) [page:Box3 this]</h3>
+		<h3>[method:Box3 applyMatrix4]( [page:Matrix4 matrix] )</h3>
 		<div>
-		min -- Lower (x, y, z) boundary of the box. <br>
-		max -- Upper (x, y, z) boundary of the box.
-		</div>
-		<div>
-		Sets the lower and upper (x, y, z) boundaries of this box.
-		</div>
+		[page:Matrix4 matrix] - The [page:Matrix4] to apply<br /><br />
 
-		<h3>[method:Box3 applyMatrix4]( [page:Matrix4 matrix] ) [page:Box3 this]</h3>
-		<div>
-		matrix -- The [page:Matrix4] to apply
-		</div>
-		<div>
 		Transforms this Box3 with the supplied matrix.
 		</div>
 
-		<h3>[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
-		<div>
-		point -- Position to clamp. <br>
-		optionalTarget -- If specified, the clamped result will be copied here.
-		</div>
+		<h3>[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )</h3>
 		<div>
-		Clamps *point* within the bounds of this box.
-		</div>
+		[page:Vector3 point] - [page:Vector3] to clamp. <br>
+		[page:Vector3 optionalTarget] - If specified, the clamped result will be copied into this [page:Vector3].<br /><br />
 
-		<h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Box3 this]</h3>
-		<div>
-		box -- Box to check for intersection against.
-		</div>
-		<div>
-		Determines whether or not this box intersects *box*.
+		[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the [page:Vector3 point] within the bounds of this box.<br />
+		Note: if [page:Vector3 optionalTarget] is not specified, a new [page:Vector3] will be returned. The original point
+		is not modified.
 		</div>
 
-		<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] ) [page:Box3 this]</h3>
+
+		<h3>[method:Box3 clone]()</h3>
+		<div>Returns a new [page:Box3] with the same [page:.min] and [page:.max] as this one.</div>
+
+		<h3>[method:Boolean containsBox]( [page:Box3 box] )</h3>
 		<div>
-		sphere -- Sphere to check for intersection against.
+		[page:Box3 box] - [page:Box3 Box3] to test for inclusion.<br /><br />
+
+		Returns true if this box includes the entirety of [page:Box3 box]. If this and [page:Box3 box] are identical, <br>
+		this function also returns true.
 		</div>
+
+		<h3>[method:Boolean containsPoint]( [page:Vector3 point] )</h3>
 		<div>
-		Determines whether or not this box intersects *sphere*.
+		[page:Vector3 point] - [page:Vector3] to check for inclusion.<br /><br />
+
+		Returns true if the specified [page:Vector3 point] lies within or on the boundaries of this box.
 		</div>
 
-		<h3>[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Box3 this]</h3>
+		<h3>[method:Box3 copy]( [page:Box3 box] )</h3>
 		<div>
-		plane -- Plane to check for intersection against.
+		[page:Box3 box]  - [page:Box3] to copy.<br /><br />
+
+		Copies the [page:.min] and [page:.max] from [page:Box3 box] to this box.
 		</div>
+
+		<h3>[method:Float distanceToPoint]( [page:Vector3 point] )</h3>
 		<div>
-		Determines whether or not this box intersects *plane*.
+		[page:Vector3 point] - [page:Vector3] to measure distance to.<br /><br />
+
+		Returns the distance from any edge of this box to the specified point.
+		If the [page:Vector3 point] lies inside of this box, the distance will be 0.
 		</div>
 
-		<h3>[method:Box3 setFromPoints]( [page:Array points] ) [page:Box3 this]</h3>
+		<h3>[method:Boolean equals]( [page:Box3 box] )</h3>
 		<div>
-		points -- Set of points that the resulting box will envelop.
+		[page:Box3 box] - Box to compare with this one.<br /><br />
+
+		Returns true if this box and [page:Box3 box] share the same lower and upper bounds.
 		</div>
+
+		<h3>[method:Box3 expandByPoint]( [page:Vector3 point] )</h3>
 		<div>
-		Sets the upper and lower bounds of this box to include all of the points in *points*.
+		[page:Vector3 point] - [page:Vector3] that should be included in the box.<br /><br />
+
+		Expands the boundaries of this box to include [page:Vector3 point].
 		</div>
 
-		<h3>[method:Box3 setFromObject]( [page:Object3D object] ) [page:Box3 this]</h3>
+		<h3>[method:Box3 expandByScalar]( [page:float scalar] )</h3>
 		<div>
-		object -- [page:Object3D] to compute the bounding box for.
+		[page:float scalar] - Distance to expand the box by.<br /><br />
+
+		Expands each dimension of the box by [page:float scalar]. If negative, the dimensions of the box
+		will be contracted.
 		</div>
+
+		<h3>[method:Box3 expandByVector]( [page:Vector3 vector] )</h3>
 		<div>
-		Computes the world-axis-aligned bounding box of an object (including its children), <br>
-		accounting for both the object's, and childrens', world transforms
+		[page:Vector3 vector] - [page:Vector3] to expand the box by.<br /><br />
+
+		Expands this box equilaterally by [page:Vector3 vector]. The width of this box will be
+		expanded by the x component of [page:Vector3 vector] in both directions. The height of
+		this box will be expanded by the y component of [page:Vector3 vector] in both directions.
+		The depth of this box will be expanded by the z component of *vector* in both directions.
 		</div>
 
 
 
-		<h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
-		<div>
-		optionalTarget -- If specified, the result will be copied here.
-		</div>
+		<h3>[method:Sphere getBoundingSphere]( [page:Sphere optionalTarget] )</h3>
 		<div>
-		Returns the width, height, and depth of this box.
-		</div>
+		[page:Sphere optionalTarget] -  If specified, the  result will be copied into this [page:Sphere].<br /><br />
 
-		<h3>[method:Box3 union]( [page:Box3 box] ) [page:Box3 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 <br>
-		two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' <br>
-		lower bounds.
+		Gets a [page:Sphere] that bounds the box. If [page:Sphere optionalTarget] is not set,
+		a new [page:Sphere] containing the result will be returned.
 		</div>
 
-		<h3>[method:Vector3 getParameter]( [page:Vector3 point], [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
+		<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] )</h3>
 		<div>
-		point -- Point to parametrize.
-		optionalTarget -- If specified, the result will be copied here.
+		[page:Vector3 optionalTarget] - (optional) If specified, the result will be copied into this [page:Vector3].<br /><br />
+
+		Returns the center point of the box as a [page:Vector3]. If [page:Vector3 optionalTarget] is not set,
+		a new [page:Vector3] containing the result will be returned.
 		</div>
+
+		<h3>[method:Vector3 getParameter]( [page:Vector3 point], [page:Vector3 optionalTarget] ) </h3>
 		<div>
-		Returns point as a proportion of this box's width and height.
+		[page:Vector3 point] - [page:Vector3].<br/>
+		optionalTarget - (optional) If specified, the result will be copied into this [page:Vector3].<br/><br/>
+
+		Returns a point as a proportion of this box's width and height. If [page:Vector3 optionalTarget] is not set,
+		a new [page:Vector3] containing the result will be returned.
 		</div>
 
-		<h3>[method:Box3 intersect]( [page:Box3 box] ) [page:Box3 this]</h3>
+		<h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] )</h3>
 		<div>
-		box -- Box to intersect with.
+		optionalTarget - (optional) If specified, the result will be copied into this [page:Vector3].<br /><br />
+
+		Returns the width and height of this box. If [page:Vector3 optionalTarget] is not set,
+		a new [page:Vector3] containing the result will be returned.
 		</div>
+
+		<h3>[method:Box3 intersect]( [page:Box3 box] )</h3>
 		<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>
+		[page:Box3 box] - Box to intersect with.<br /><br />
+
+		Returns the intersection of this and [page:Box3 box], 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.
 		</div>
 
-		<h3>[method:Boolean containsBox]( [page:Box3 box] ) [page:Box3 this]</h3>
+		<h3>[method:Boolean intersectsBox]( [page:Box3 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>
+		[page:Box3 box] - Box to check for intersection against.<br /><br />
 
-		<h3>[method:Boolean containsPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
-		<div>
-		point -- [page:Vector3] to check for inclusion.
-		</div>
-		<div>
-		Returns true if the specified point lies within the boundaries of this box.
+		Determines whether or not this box intersects [page:Box3 box].
 		</div>
 
-		<h3>[method:Box3 translate]( [page:Vector3 offset] ) [page:Box3 this]</h3>
+		<h3>[method:Boolean intersectsPlane]( [page:Plane plane] )</h3>
 		<div>
-		offset -- Direction and distance of offset.
+		[page:Plane plane] - [page:Plane] to check for intersection against.<br /><br />
+
+		Determines whether or not this box intersects [page:Plane plane].
 		</div>
+
+		<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] )</h3>
 		<div>
-		Adds *offset* to both the upper and lower bounds of this box, effectively moving this box <br>
-		*offset* units in 3D space.
+		[page:Sphere sphere] - [page:Sphere] to check for intersection against.<br /><br />
+
+		Determines whether or not this box intersects [page:Sphere sphere].
 		</div>
 
-		<h3>[method:Boolean isEmpty]() [page:Box3 this]</h3>
+		<h3>[method:Boolean isEmpty]()</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 <br>
-		one both bounds share.
+		Note that a box with equal lower and upper bounds still includes one point,
+		the one both bounds share.
 		</div>
 
-		<h3>[method:Box3 clone]() [page:Box3 this]</h3>
-		<div>
-		Returns a copy of this box.
-		</div>
+		<h3>[method:Box3 makeEmpty]()</h3>
+		<div>Makes this box empty.</div>
 
-		<h3>[method:Boolean equals]( [page:Box3 box] ) [page:Box3 this]</h3>
+		<h3>[method:Box3 set]( [page:Vector3 min], [page:Vector3 max] )</h3>
 		<div>
-		box -- Box to compare.
-		</div>
-		<div>
-		Returns true if this box and *box* share the same lower and upper bounds.
-		</div>
+		[page:Vector3 min] - [page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
+		[page:Vector3 max] - [page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br /><br />
 
-		<h3>[method:Box3 expandByPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
-		<div>
-		point -- Point that should be included in the box.
-		</div>
-		<div>
-		Expands the boundaries of this box to include *point*.
+		Sets the lower and upper (x, y, z) boundaries of this box.
 		</div>
 
-		<h3>[method:Box3 expandByScalar]( [page:float scalar] ) [page:Box3 this]</h3>
-		<div>
-		scalar -- Distance to expand.
-		</div>
+		<h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] )</h3>
 		<div>
-		Expands each dimension of the box by *scalar*. If negative, the dimensions of the box <br/>
-		will be contracted.
-		</div>
+		[page:Vector3 center] - Desired center position of the box ([page:Vector3]). <br>
+		[page:Vector3 size] - Desired x and y dimensions of the box ([page:Vector3]).<br /><br />
 
-		<h3>[method:Box3 expandByVector]( [page:Vector3 vector] ) [page:Box3 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 <br>
-		expanded by the x component of *vector* in both directions. The height of <br>
-		this box will be expanded by the y component of *vector* in both directions. <br>
-		The depth of this box will be expanded by the z component of *vector* in <br>
-		both directions.
+		Centers this box on [page:Vector3 center] and sets this box's width and height to the values specified
+		in [page:Vector3 size].
 		</div>
 
-		<h3>[method:Box3 copy]( [page:Box3 box] ) [page:Box3 this]</h3>
-		<div>
-		box -- Box to copy.
-		</div>
-		<div>
-		Copies the values of *box* to this box.
-		</div>
 
-		<h3>[method:Box3 makeEmpty]() [page:Box3 this]</h3>
-		<div>
-		Makes this box empty.
-		</div>
 
-		<h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3>
-		<div>
-		optionalTarget -- If specified, the result will be copied here.
-		</div>
+		<h3>[method:Box3 setFromObject]( [page:Object3D object] )</h3>
 		<div>
-		Returns the center point of this box.
-		</div>
+		[page:Object3D object] - [page:Object3D] to compute the bounding box of.<br /><br />
 
-		<h3>[method:Sphere getBoundingSphere]( [page:Sphere optionalTarget] ) [page:Box3 this]</h3>
-		<div>
-		optionalTarget -- [page:Sphere] to optionally set the result to.
-		</div>
-		<div>
-		Gets a sphere that bounds the box.
+		Computes the world-axis-aligned bounding box of an [page:Object3D] (including its children),
+		accounting for both the object's, and childrens', world transforms.
 		</div>
 
-		<h3>[method:Float distanceToPoint]( [page:Vector3 point] ) [page:Box3 this]</h3>
-		<div>
-		point -- Point to measure distance to.
-		</div>
+		<h3>[method:Box3 setFromPoints]( [page:Array points] )</h3>
 		<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.
+		[page:Array points] - Array of [page:Vector3 Vector3s] that the resulting box will contain.<br /><br />
+
+		Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
 		</div>
 
-		<h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] ) [page:Box3 this]</h3>
+		<h3>[method:Box3 translate]( [page:Vector3 offset] )</h3>
 		<div>
-		center -- Desired center position of the box. <br>
-		size -- Desired x, y and z dimensions of the box.
+		[page:Vector3 offset] - Direction and distance of offset.<br /><br />
+
+		Adds [page:Vector3 offset] to both the upper and lower bounds of this box, effectively moving this box
+		[page:Vector3 offset] units in 2D space.
 		</div>
+
+		<h3>[method:Box3 union]( [page:Box3 box] )</h3>
 		<div>
-		Centers this box on *center* and sets this box's width, height and depth to the values specified <br>
-		in *size*.
+		[page:Box3 box] - Box that will be unioned with this box.<br /><br />
+
+		Unions this box with [page:Box3 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>
 
 		<h2>Source</h2>