Skip to content

Commit 84b07d6

Browse files
committed
edit docs
1 parent aeda01c commit 84b07d6

File tree

1 file changed

+44
-18
lines changed

1 file changed

+44
-18
lines changed

glutil.js

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,13 +1476,21 @@ function Scene3D(canvasOrContext){
14761476
Scene3D.prototype.getContext=function(){
14771477
return this.context;
14781478
}
1479-
/** @const No face culling. */
1479+
/** No face culling.
1480+
@const */
14801481
Scene3D.NONE = 0;
1481-
/** @const Back side of a triangle. By default, triangles with clockwise winding are back-facing. */
1482+
/** Back side of a triangle. By default, triangles with clockwise winding are back-facing.
1483+
@const */
14821484
Scene3D.BACK = 1;
1483-
/** @const Front side of a triangle. By default, triangles with counterclockwise winding are front-facing. */
1485+
/**
1486+
Front side of a triangle. By default, triangles with counterclockwise winding are front-facing.
1487+
@const
1488+
*/
14841489
Scene3D.FRONT = 2;
1485-
/** @const Back and front sides of a triangle. */
1490+
/**
1491+
Back and front sides of a triangle.
1492+
@const
1493+
*/
14861494
Scene3D.FRONT_AND_BACK = 3;
14871495
/**
14881496
* Counterclockwise winding. A triangle has counterclockwise winding if
@@ -2017,9 +2025,10 @@ Scene3D.prototype.removeShape=function(shape){
20172025
return this;
20182026
}
20192027
/**
2020-
*
2028+
* Sets a light source in this scene to a directional light.
20212029
* @param {number} index Zero-based index of the light to set. The first
2022-
* light has index 0, the second has index 1, and so on.
2030+
* light has index 0, the second has index 1, and so on. Will be created
2031+
* if the light doesn't exist.
20232032
* @param {Array<number>} position A 3-element vector giving the direction of the light, along the X, Y, and Z
20242033
* axes, respectively. May be null, in which case the default
20252034
* is (0, 0, 1).
@@ -2039,9 +2048,12 @@ Scene3D.prototype.setDirectionalLight=function(index,position,diffuse,specular){
20392048
return this;
20402049
}
20412050
/**
2042-
* Not documented yet.
2043-
* @param {*} index
2044-
* @param {*} params
2051+
* Sets parameters for a light in this scene.
2052+
* @param {number} index Zero-based index of the light to set. The first
2053+
* light has index 0, the second has index 1, and so on. Will be created
2054+
* if the light doesn't exist.
2055+
* @param {object} params An object as described in {@link glutil.LightSource.setParams}.
2056+
* @return {glutil.Scene3D} This object.
20452057
*/
20462058
Scene3D.prototype.setLightParams=function(index,params){
20472059
this.lightSource.setParams(index,params);
@@ -2069,7 +2081,7 @@ Scene3D.prototype.setAmbient=function(r,g,b,a){
20692081
}
20702082

20712083
/**
2072-
*
2084+
* Sets a light source in this scene to a point light
20732085
* @param {number} index Zero-based index of the light to set. The first
20742086
* light has index 0, the second has index 1, and so on.
20752087
* @param {Array<number>} position
@@ -2269,13 +2281,16 @@ ShapeGroup.prototype.addShape=function(shape){
22692281
return this;
22702282
}
22712283
/**
2272-
* Not documented yet.
2284+
* Gets a reference to the transform used by this shape group object.
2285+
* @return {glutil.Transform}
22732286
*/
22742287
ShapeGroup.prototype.getTransform=function(){
22752288
return this.transform;
22762289
}
22772290
/**
2278-
* Not documented yet.
2291+
* Gets a copy of the transformation needed to transform
2292+
* this shape group's coordinates to world coordinates.
2293+
* @return {glutil.Transform} A 4x4 matrix.
22792294
*/
22802295
ShapeGroup.prototype.getMatrix=function(){
22812296
var xform=this.getTransform();
@@ -2303,7 +2318,8 @@ ShapeGroup.prototype.setTransform=function(transform){
23032318
return this;
23042319
}
23052320
/**
2306-
* Not documented yet.
2321+
* Gets the number of vertices composed by this all shapes in this shape group.
2322+
* @return {number}
23072323
*/
23082324
ShapeGroup.prototype.vertexCount=function(){
23092325
var c=0;
@@ -2313,7 +2329,9 @@ ShapeGroup.prototype.vertexCount=function(){
23132329
return c;
23142330
}
23152331
/**
2316-
* Not documented yet.
2332+
* Gets the number of primitives (triangles, lines,
2333+
* and points) composed by all shapes in this shape group.
2334+
* @return {number}
23172335
*/
23182336
ShapeGroup.prototype.primitiveCount=function(){
23192337
var c=0;
@@ -2323,7 +2341,9 @@ ShapeGroup.prototype.primitiveCount=function(){
23232341
return c;
23242342
}
23252343
/**
2326-
* Not documented yet.
2344+
* Gets the number of vertices composed by
2345+
* all shapes in this scene.
2346+
* @return {number}
23272347
*/
23282348
Scene3D.prototype.vertexCount=function(){
23292349
var c=0;
@@ -2333,7 +2353,9 @@ Scene3D.prototype.vertexCount=function(){
23332353
return c;
23342354
}
23352355
/**
2336-
* Not documented yet.
2356+
* Gets the number of primitives (triangles, lines,
2357+
* and points) composed by all shapes in this scene.
2358+
* @return {number}
23372359
*/
23382360
Scene3D.prototype.primitiveCount=function(){
23392361
var c=0;
@@ -2399,13 +2421,17 @@ function Shape(mesh){
23992421
this.parent=null;
24002422
}
24012423
/**
2402-
* Not documented yet.
2424+
* Gets the number of vertices composed by
2425+
* all shapes in this scene.
2426+
* @return {number}
24032427
*/
24042428
Shape.prototype.vertexCount=function(){
24052429
return (this.bufferedMesh) ? this.bufferedMesh.vertexCount() : 0;
24062430
}
24072431
/**
2408-
* Not documented yet.
2432+
* Gets the number of primitives (triangles, lines,
2433+
* and points) composed by all shapes in this scene.
2434+
* @return {number}
24092435
*/
24102436
Shape.prototype.primitiveCount=function(){
24112437
return (this.bufferedMesh) ? this.bufferedMesh.primitiveCount() : 0;

0 commit comments

Comments
 (0)