Skip to content

Commit 43f6305

Browse files
committed
edit docs
1 parent 508c652 commit 43f6305

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

glmath.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ var GLMath={
3434
/**
3535
* Finds the cross product of two 3-element vectors.
3636
* The cross product is the vector that is perpendicular to
37-
* each of two other vectors. If both vectors are unit length
37+
* each of two other vectors.<p>
38+
* If both vectors are unit length
3839
* (via {@link glmath.GLMath.vec3norm}), the sine of
3940
* the angle between them is equal to the length of their
4041
* cross product. <small>(More formally, the length of the cross
@@ -58,12 +59,14 @@ return [a[1]*b[2]-a[2]*b[1],
5859
/**
5960
* Finds the dot product of two 3-element vectors. It's the
6061
* sum of the products of their components (for example, <b>a</b>'s X times <b>b</b>'s X).
61-
* If both vectors are unit length
62+
* <p>If both vectors are unit length
6263
* (via {@link glmath.GLMath.vec3norm}), the cosine
6364
* of the angle between them is equal to their dot product.
6465
* <small>(More formally, the dot
6566
* product equals |<b>a</b>| * |<b>b</b>| * cos &theta;
6667
* where |<b>x</b>| is the length of vector <b>x</b>.)</small>
68+
* <p>A dot product of 0 indicates that the two vectors
69+
* are <i>orthogonal</i> (perpendicular) to each other.
6770
* @param {Array<number>} a The first vector.
6871
* @param {Array<number>} b The second vector.
6972
* @return {number} A number representing the dot product.
@@ -1074,7 +1077,7 @@ mat4translate:function(mat,v3,v3y,v3z){
10741077
* <li>For <code>mat4perspective</code> and <code>mat4frustum</code>,
10751078
* the "near" parameter should not be 0 or less, and should be set to the highest distance
10761079
* from the camera that the application can afford to clip out for being too
1077-
* close, for example, 0.1, 1, or higher. This doesn't apply to <code>mat4ortho</code>.</li>
1080+
* close, for example, 0.5, 1, or higher. This doesn't apply to <code>mat4ortho</code>.</li>
10781081
* <li>The difference between "far" and "near" should not be greater than 65536
10791082
* (the number of possible values per pixel in a 16-bit depth buffer) and should be
10801083
* as small as the application can accept. In any case, "far" should be greater than

glutil.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ function Material(ambient, diffuse, specular,shininess,emission) {
675675
* on lights that give off specular highlights as well as on the color
676676
* of those highlights. Similar to diffuse reflection, specular reflection
677677
* is affected by how directly each part of an object faces
678-
* a light that gives off specular highlights.
678+
* a light that gives off specular highlights, but unlike diffuse light,
679+
* specular light doesn't scatter very much to other parts of an object.
679680
* (0,0,0) means no specular reflection,
680681
* and (1,1,1) means total specular reflection.<p>
681682
*/
@@ -1871,16 +1872,32 @@ Scene3D.prototype._renderInner=function(){
18711872
return this;
18721873
}
18731874

1875+
/**
1876+
* Represents a grouping of shapes.
1877+
* @class
1878+
* @alias glutil.ShapeGroup
1879+
*/
18741880
function ShapeGroup(){
18751881
this.shapes=[];
18761882
this.transform=new Transform();
18771883
}
1884+
/**
1885+
* Not documented yet.
1886+
* @param {*} shape
1887+
*/
18781888
ShapeGroup.prototype.addShape=function(shape){
18791889
this.shapes.add(shape);
18801890
}
1891+
/**
1892+
* Not documented yet.
1893+
*/
18811894
ShapeGroup.prototype.getTransform=function(){
18821895
return this.getTransform();
18831896
}
1897+
/**
1898+
* Not documented yet.
1899+
* @param {*} transform
1900+
*/
18841901
ShapeGroup.prototype.setTransform=function(transform){
18851902
this.transform=transform.copy();
18861903
return this;
@@ -1967,9 +1984,16 @@ Shape.prototype.copy=function(){
19671984
ret.transform=this.getTransform().copy();
19681985
return ret;
19691986
}
1987+
/**
1988+
* Not documented yet.
1989+
*/
19701990
Shape.prototype.getTransform=function(){
19711991
return this.transform;
19721992
}
1993+
/**
1994+
* Not documented yet.
1995+
* @param {*} transform
1996+
*/
19731997
Shape.prototype.setTransform=function(transform){
19741998
this.transform=transform.copy();
19751999
return this;

0 commit comments

Comments
 (0)