Skip to content

Commit 9abe2ec

Browse files
committed
edit docs
1 parent d1571ba commit 9abe2ec

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

camera.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ Camera.prototype.turnHorizontal=function(angleDegrees){
164164
Camera.prototype.getPosition=function(){
165165
return this.position.slice(0,3);
166166
}
167-
167+
/**
168+
* Not documented yet.
169+
* @param {*} dist
170+
*/
168171
Camera.prototype.setDistance=function(dist){
169172
if(dist<0)throw new Error("invalid distance")
170173
if(dist<this.near)dist=this.near;

glmath.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,14 +1081,15 @@ mat4perspective:function(fovY,aspectRatio,nearZ,farZ){
10811081
* 10, 12, and 14).
10821082
* @param {Array<number>} viewerPos A 3-element vector specifying
10831083
* the camera position in world space.
1084-
* @param {Array<number>|undefined} lookingAt A 3-element vector specifying
1084+
* @param {Array<number>} [lookingAt] A 3-element vector specifying
10851085
* the point in world space that the camera is looking at. May be null or omitted,
10861086
* in which case the default is the coordinates (0,0,0).
1087-
* @param {Array<number>|undefined} up A 3-element vector specifying
1087+
* @param {Array<number>} [up] A 3-element vector specifying
10881088
* the up-vector direction. May be null or omitted, in which case
10891089
* the default is a vector pointing positive on the Y axis. This
10901090
* vector must not point in the same or opposite direction as
1091-
* the camera's view direction.
1091+
* the camera's view direction. (For best results, rotate the vector (0, 1, 0)
1092+
* so it points perpendicular to the camera's view direction.)
10921093
* @return {Array<number>} The resulting 4x4 matrix.
10931094
*/
10941095
mat4lookat:function(viewerPos,lookingAt,up){

glutil-mesh.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ at: http://upokecenter.dreamhosters.com/articles/donate-now-2/
1414
* See the "{@tutorial shapes}" tutorial.
1515
* @class
1616
* @alias glutil.Mesh
17-
* @param {Array<number>|undefined} vertices An array that contains data on each
17+
* @param {Array<number>} [vertices] An array that contains data on each
1818
* vertex of the mesh.
1919
* Each vertex is made up of the same number of elements, as defined in
2020
* format. If null or omitted, creates an initially empty mesh.
2121
* May be null or omitted, in which case an empty vertex array is used.
22-
* @param {Array<number>|undefined} indices An array of vertex indices. Each trio of
22+
* @param {Array<number>} [indices] An array of vertex indices. Each trio of
2323
* indices specifies a separate triangle, or each pair of indices specifies
2424
* a line segment.
2525
* If null or omitted, creates an initially empty mesh.
26-
* @param {number|undefined} format A set of bit flags depending on the kind of data
26+
* @param {number} [format] A set of bit flags depending on the kind of data
2727
* each vertex contains. Each vertex contains 3 elements plus:<ul>
2828
* <li> 3 more elements if Mesh.NORMALS_BIT is set, plus
2929
* <li> 3 more elements if Mesh.COLORS_BIT is set, plus

glutil-shaderprog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ at: http://upokecenter.dreamhosters.com/articles/donate-now-2/
2727
* compiled shader program, or an object, such as Scene3D, that
2828
* implements a no-argument <code>getContext</code> method
2929
* that returns a WebGL context.
30-
* @param {String|undefined} vertexShader Source text of a vertex shader, in OpenGL
30+
* @param {String} [vertexShader] Source text of a vertex shader, in OpenGL
3131
* ES Shading Language (GLSL). If null, a default
3232
* vertex shader is used instead.
33-
* @param {String|undefined} fragmentShader Source text of a fragment shader in GLSL.
33+
* @param {String} [fragmentShader] Source text of a fragment shader in GLSL.
3434
* If null, a default fragment shader is used instead.
3535
*/
3636
var ShaderProgram=function(context, vertexShader, fragmentShader){

glutil.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ var GLUtil={
149149
* resolves after the given list of promises finishes
150150
* its work.
151151
* @param {Array<Promise>} promises - an array containing promise objects
152-
* @param {Function|undefined} progressResolve - a function called as each
152+
* @param {Function} [progressResolve] - a function called as each
153153
* individual promise is resolved; optional
154-
* @param {Function|undefined} progressReject - a function called as each
154+
* @param {Function} [progressReject] - a function called as each
155155
* individual promise is rejected; optional
156156
* @return {Promise} A promise that is never rejected and resolves when
157157
* all of the promises are each resolved or rejected. The result
@@ -774,7 +774,7 @@ var Texture=function(name){
774774
* Loads a texture by its URL.
775775
* @param {string} name URL of the texture data. It will be loaded via
776776
* the JavaScript DOM's Image class
777-
* @param {Object|undefined} textureCache An object whose keys
777+
* @param {Object} [textureCache] An object whose keys
778778
* are the names of textures already loaded. This will help avoid loading
779779
* the same texture more than once. This parameter is optional
780780
* and may be omitted.
@@ -1450,9 +1450,9 @@ Scene3D.prototype.loadAndMapTexture=function(name){
14501450
* Loads one or more textures from an image URL and uploads each of them
14511451
* to a texture buffer object.
14521452
* @param {Array<string>} textureFiles A list of URLs of the image to load.
1453-
* @param {Function|undefined} resolved Called for each URL that is loaded successfully
1453+
* @param {Function} [resolved] Called for each URL that is loaded successfully
14541454
* and uploaded to a texture buffer (the argument will be a Texture object.)
1455-
* @param {Function|undefined} rejected Called for each URL for which an error
1455+
* @param {Function} [rejected] Called for each URL for which an error
14561456
* occurs (the argument will be the data passed upon
14571457
* rejection).
14581458
* @return {Promise} A promise that is resolved when
@@ -1516,14 +1516,15 @@ Scene3D.prototype.setViewMatrix=function(matrix){
15161516
* (<code>center</code>).
15171517
* @param {Array<number>} eye A 3-element vector specifying
15181518
* the camera position in world space.
1519-
* @param {Array<number>|undefined} center A 3-element vector specifying
1519+
* @param {Array<number>} [center] A 3-element vector specifying
15201520
* the point in world space that the camera is looking at. May be null or omitted,
15211521
* in which case the default is the coordinates (0,0,0).
1522-
* @param {Array<number>|undefined} up A 3-element vector specifying
1522+
* @param {Array<number>} [up] A 3-element vector specifying
15231523
* the up-vector direction. May be null or omitted, in which case
15241524
* the default is a vector pointing positive on the Y axis. This
15251525
* vector must not point in the same or opposite direction as
1526-
* the camera's view direction.
1526+
* the camera's view direction. (For best results, rotate the vector (0, 1, 0)
1527+
* so it points perpendicular to the camera's view direction.)
15271528
* @return {glutil.Scene3D} This object.
15281529
*/
15291530
Scene3D.prototype.setLookAt=function(eye, center, up){

0 commit comments

Comments
 (0)