Browse Source

Doc maths (#9884)

* Vector3.setFromMatrixColumn parameters reordered

* add Matrix[3|4].fromArray offset parameter

* document missing Box3.intersects* methods

* add missing Plane.intersects* methods

* add missing Sphere.intersects* methods

* document Color,setScalar method

* revise text

* add missing Vector*.setScalar methods
aardgoose 8 years ago
parent
commit
22fe965752

+ 16 - 0
docs/api/math/Box3.html

@@ -77,6 +77,22 @@
 		Determines whether or not this box intersects *box*.
 		</div>
 
+		<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] ) [page:Box3 this]</h3>
+		<div>
+		sphere -- Sphere to check for intersection against.
+		</div>
+		<div>
+		Determines whether or not this box intersects *sphere*.
+		</div>
+
+		<h3>[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Box3 this]</h3>
+		<div>
+		plane -- Plane to check for intersection against.
+		</div>
+		<div>
+		Determines whether or not this box intersects *plane*.
+		</div>
+
 		<h3>[method:Box3 setFromPoints]( [page:Array points] ) [page:Box3 this]</h3>
 		<div>
 		points -- Set of points that the resulting box will envelop.

+ 8 - 0
docs/api/math/Color.html

@@ -165,6 +165,14 @@
 		Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
 		</div>
 
+		<h3>[method:Color setScalar]( [page:Float scalar] ) [page:Color this]</h3>
+		<div>
+		scalar — a value between 0.0 and 1.0.
+		</div>
+		<div>
+		Sets all three color components to the value *scalar*.
+		</div>
+
 		<h3>[method:Color setHSL]( [page:Float h], [page:Float s], [page:Float l] ) [page:Color this]</h3>
 		<div>
 		h — hue value between 0.0 and 1.0 <br />

+ 3 - 2
docs/api/math/Matrix3.html

@@ -57,9 +57,10 @@
 		Copies the values of matrix *m* into this matrix.
 		</div>
 
-		<h3>[method:Matrix3 fromArray]( [page:Array array] ) [page:Matrix3 this]</h3>
+		<h3>[method:Matrix3 fromArray]( [page:Array array], [page:Integer offset] ) [page:Matrix3 this]</h3>
 		<div>
-		array -- [page:Array] The array to read the elements from.
+		array -- [page:Array] The array to read the elements from.<br />
+		offset -- [page:Integer] optional offset into the array. Default is 0.
 		</div>
 		<div>
 		Sets the elements of this matrix based on an array in column-major format.

+ 3 - 2
docs/api/math/Matrix4.html

@@ -67,9 +67,10 @@
 		Copies the values of matrix *m* into this matrix.
 		</div>
 
-		<h3>[method:Matrix4 fromArray]( [page:Array array] ) [page:Matrix4 this]</h3>
+		<h3>[method:Matrix4 fromArray]( [page:Array array], [page:Integer offset] ) [page:Matrix4 this]</h3>
 		<div>
-		array -- [page:Array] The array to read the elements from.
+		array -- [page:Array] The array to read the elements from.<br />
+		offset -- [page:Integer] optional offset into the array. Default is 0.
 		</div>
 		<div>
 		Sets the elements of this matrix based on an array in column-major format.

+ 16 - 0
docs/api/math/Plane.html

@@ -86,6 +86,22 @@
 		Tests whether a line segment intersects with the plane. (Do not mistake this for a collinear check.)
 		</div>
 
+		<h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Plane this]</h3>
+		<div>
+		box -- Box to check for intersection against.
+		</div>
+		<div>
+		Determines whether or not this plane intersects *box*.
+		</div>
+
+		<h3>[method:Boolean intersectsSphere]( [page:Sphere sphere] ) [page:Plane this]</h3>
+		<div>
+		sphere -- Sphere to check for intersection against.
+		</div>
+		<div>
+		Determines whether or not this plane intersects *sphere*.
+		</div>
+
 		<h3>[method:Vector3 intersectLine]( [page:Line3 line], [page:Vector3 optionalTarget] ) or [page:undefined]</h3>
 		<div>
 		line -- [page:Line3] <br />

+ 16 - 0
docs/api/math/Sphere.html

@@ -131,6 +131,22 @@
 		Checks to see if two spheres intersect.
 		</div>
 
+		<h3>[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Sphere this]</h3>
+		<div>
+		box -- Box to check for intersection against.
+		</div>
+		<div>
+		Determines whether or not this sphere intersects *box*.
+		</div>
+
+		<h3>[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Sphere this]</h3>
+		<div>
+		plane -- Plane to check for intersection against.
+		</div>
+		<div>
+		Determines whether or not this sphere intersects *plane*.
+		</div>
+
 		<h3>[method:Boolean empty]()</h3>
 		<div>
 		Checks to see if the sphere is empty (the radius set to 0).

+ 8 - 0
docs/api/math/Vector2.html

@@ -64,6 +64,14 @@
 		replace this vector's y value with y.
 		</div>
 
+		<h3>[method:Vector2 setScalar]( [page:Float scalar] ) [page:Vector2 this]</h3>
+		<div>
+		scalar -- [page:Float]
+		</div>
+		<div>
+		set all component values of this vector to *scalar*.
+		</div>
+
 		<h3>[method:Vector2 copy]( [page:Vector2 v] ) [page:Vector2 this]</h3>
 		<div>
 		Copies value of *v* to this vector.

+ 11 - 3
docs/api/math/Vector3.html

@@ -68,6 +68,14 @@
 		Sets z value of this vector.
 		</div>
 
+		<h3>[method:Vector3 setScalar]( [page:Float scalar] ) [page:Vector3 this]</h3>
+		<div>
+		scalar -- [page:Float]
+		</div>
+		<div>
+		set all component values of this vector to *scalar*.
+		</div>
+
 		<h3>[method:Vector3 copy]( [page:Vector3 v] ) [page:Vector3 this]</h3>
 		<div>
 		Copies value of *v* to this vector.
@@ -380,10 +388,10 @@
 		Returns the angle between this vector and vector v in radians.
 		</div>
 
-		<h3>[method:Vector3 setFromMatrixColumn]( [page:Integer index], [page:Matrix4 matrix] ) [page:Vector3 this]</h3>
+		<h3>[method:Vector3 setFromMatrixColumn]( [page:Matrix4 matrix], [page:Integer index] ) [page:Vector3 this]</h3>
 		<div>
-		index -- 0, 1, 2, or 3 <br />
-		matrix -- [page:Matrix4]
+		matrix -- [page:Matrix4]<br />
+		index -- 0, 1, 2, or 3
 		</div>
 		<div>
 		Sets this vector's x, y, and z equal to the column of the matrix specified by the index.

+ 8 - 0
docs/api/math/Vector4.html

@@ -75,6 +75,14 @@
 		Sets the w component of the vector.
 		</div>
 
+		<h3>[method:Vector4 setScalar]( [page:Float scalar] ) [page:Vector4 this]</h3>
+		<div>
+		scalar -- [page:Float]
+		</div>
+		<div>
+		set all component values of this vector to *scalar*.
+		</div>
+
 		<h3>[method:Vector4 copy]( [page:Vector4 v] ) [page:Vector4 this]</h3>
 		<div>
 		Copies value of *v* to this vector.