Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some updates to ensure JSDoc produces clean results.

  • Loading branch information...
commit 7afc639b39858ef78b129b691554122ba3c88451 1 parent cefeed1
@toji authored
View
8 src/gl-matrix/mat2.js
@@ -173,7 +173,7 @@ mat2.determinant = function (a) {
* @param {mat2} b the second operand
* @returns {mat2} out
*/
-mat2.mul = mat2.multiply = function (out, a, b) {
+mat2.multiply = function (out, a, b) {
var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];
var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
out[0] = a0 * b0 + a1 * b2;
@@ -184,6 +184,12 @@ mat2.mul = mat2.multiply = function (out, a, b) {
};
/**
+ * Alias for {@link mat2.multiply}
+ * @function
+ */
+mat2.mul = mat2.multiply;
+
+/**
* Rotates a mat2 by the given angle
*
* @param {mat2} out the receiving matrix
View
8 src/gl-matrix/mat3.js
@@ -218,7 +218,7 @@ mat3.determinant = function (a) {
* @param {mat3} b the second operand
* @returns {mat3} out
*/
-mat3.mul = mat3.multiply = function (out, a, b) {
+mat3.multiply = function (out, a, b) {
var a00 = a[0], a01 = a[1], a02 = a[2],
a10 = a[3], a11 = a[4], a12 = a[5],
a20 = a[6], a21 = a[7], a22 = a[8],
@@ -242,6 +242,12 @@ mat3.mul = mat3.multiply = function (out, a, b) {
};
/**
+ * Alias for {@link mat3.multiply}
+ * @function
+ */
+mat3.mul = mat3.multiply;
+
+/**
* Returns a string representation of a mat3
*
* @param {mat3} mat matrix to represent as a string
View
8 src/gl-matrix/mat4.js
@@ -297,7 +297,7 @@ mat4.determinant = function (a) {
* @param {mat4} b the second operand
* @returns {mat4} out
*/
-mat4.mul = mat4.multiply = function (out, a, b) {
+mat4.multiply = function (out, a, b) {
var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],
a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],
@@ -331,6 +331,12 @@ mat4.mul = mat4.multiply = function (out, a, b) {
};
/**
+ * Alias for {@link mat4.multiply}
+ * @function
+ */
+mat4.mul = mat4.multiply;
+
+/**
* Translate a mat4 by the given vector
*
* @param {mat4} out the receiving matrix
View
35 src/gl-matrix/quat.js
@@ -46,6 +46,7 @@ quat.create = function() {
*
* @param {quat} a quaternion to clone
* @returns {quat} a new quaternion
+ * @function
*/
quat.clone = vec4.clone;
@@ -57,6 +58,7 @@ quat.clone = vec4.clone;
* @param {Number} z Z component
* @param {Number} w W component
* @returns {quat} a new quaternion
+ * @function
*/
quat.fromValues = vec4.fromValues;
@@ -66,6 +68,7 @@ quat.fromValues = vec4.fromValues;
* @param {quat} out the receiving quaternion
* @param {quat} a the source quaternion
* @returns {quat} out
+ * @function
*/
quat.copy = vec4.copy;
@@ -78,6 +81,7 @@ quat.copy = vec4.copy;
* @param {Number} z Z component
* @param {Number} w W component
* @returns {quat} out
+ * @function
*/
quat.set = vec4.set;
@@ -121,6 +125,7 @@ quat.setAxisAngle = function(out, axis, rad) {
* @param {quat} a the first operand
* @param {quat} b the second operand
* @returns {quat} out
+ * @function
*/
quat.add = vec4.add;
@@ -132,7 +137,7 @@ quat.add = vec4.add;
* @param {quat} b the second operand
* @returns {quat} out
*/
-quat.mul = quat.multiply = function(out, a, b) {
+quat.multiply = function(out, a, b) {
var ax = a[0], ay = a[1], az = a[2], aw = a[3],
bx = b[0], by = b[1], bz = b[2], bw = b[3];
@@ -144,12 +149,19 @@ quat.mul = quat.multiply = function(out, a, b) {
};
/**
+ * Alias for {@link quat.multiply}
+ * @function
+ */
+quat.mul = quat.multiply;
+
+/**
* Scales a quat by a scalar number
*
* @param {quat} out the receiving vector
* @param {quat} a the vector to scale
* @param {quat} b amount to scale the vector by
* @returns {quat} out
+ * @function
*/
quat.scale = vec4.scale;
@@ -241,6 +253,7 @@ quat.calculateW = function (out, a) {
* @param {quat} a the first operand
* @param {quat} b the second operand
* @returns {Number} dot product of a and b
+ * @function
*/
quat.dot = vec4.dot;
@@ -252,6 +265,7 @@ quat.dot = vec4.dot;
* @param {quat} b the second operand
* @param {Number} t interpolation amount between the two inputs
* @returns {quat} out
+ * @function
*/
quat.lerp = vec4.lerp;
@@ -348,16 +362,30 @@ quat.conjugate = function (out, a) {
*
* @param {quat} a vector to calculate length of
* @returns {Number} length of a
+ * @function
*/
-quat.len = quat.length = vec4.length;
+quat.length = vec4.length;
+
+/**
+ * Alias for {@link quat.length}
+ * @function
+ */
+quat.len = quat.length;
/**
* Caclulates the squared length of a quat
*
* @param {quat} a vector to calculate squared length of
* @returns {Number} squared length of a
+ * @function
+ */
+quat.squaredLength = vec4.squaredLength;
+
+/**
+ * Alias for {@link quat.squaredLength}
+ * @function
*/
-quat.sqrLen = quat.squaredLength = vec4.squaredLength;
+quat.sqrLen = quat.squaredLength;
/**
* Normalize a quat
@@ -365,6 +393,7 @@ quat.sqrLen = quat.squaredLength = vec4.squaredLength;
* @param {quat} out the receiving quaternion
* @param {quat} a quaternion to normalize
* @returns {quat} out
+ * @function
*/
quat.normalize = vec4.normalize;
View
57 src/gl-matrix/vec2.js
@@ -115,13 +115,19 @@ vec2.add = function(out, a, b) {
* @param {vec2} b the second operand
* @returns {vec2} out
*/
-vec2.sub = vec2.subtract = function(out, a, b) {
+vec2.subtract = function(out, a, b) {
out[0] = a[0] - b[0];
out[1] = a[1] - b[1];
return out;
};
/**
+ * Alias for {@link vec2.subtract}
+ * @function
+ */
+vec2.sub = vec2.subtract;
+
+/**
* Multiplies two vec2's
*
* @param {vec2} out the receiving vector
@@ -129,13 +135,19 @@ vec2.sub = vec2.subtract = function(out, a, b) {
* @param {vec2} b the second operand
* @returns {vec2} out
*/
-vec2.mul = vec2.multiply = function(out, a, b) {
+vec2.multiply = function(out, a, b) {
out[0] = a[0] * b[0];
out[1] = a[1] * b[1];
return out;
};
/**
+ * Alias for {@link vec2.multiply}
+ * @function
+ */
+vec2.mul = vec2.multiply;
+
+/**
* Divides two vec2's
*
* @param {vec2} out the receiving vector
@@ -143,13 +155,19 @@ vec2.mul = vec2.multiply = function(out, a, b) {
* @param {vec2} b the second operand
* @returns {vec2} out
*/
-vec2.div = vec2.divide = function(out, a, b) {
+vec2.divide = function(out, a, b) {
out[0] = a[0] / b[0];
out[1] = a[1] / b[1];
return out;
};
/**
+ * Alias for {@link vec2.divide}
+ * @function
+ */
+vec2.div = vec2.divide;
+
+/**
* Returns the minimum of two vec2's
*
* @param {vec2} out the receiving vector
@@ -198,50 +216,74 @@ vec2.scale = function(out, a, b) {
* @param {vec2} b the second operand
* @returns {Number} distance between a and b
*/
-vec2.dist = vec2.distance = function(a, b) {
+vec2.distance = function(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1];
return Math.sqrt(x*x + y*y);
};
/**
+ * Alias for {@link vec2.distance}
+ * @function
+ */
+vec2.dist = vec2.distance;
+
+/**
* Calculates the squared euclidian distance between two vec2's
*
* @param {vec2} a the first operand
* @param {vec2} b the second operand
* @returns {Number} squared distance between a and b
*/
-vec2.sqrDist = vec2.squaredDistance = function(a, b) {
+vec2.squaredDistance = function(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1];
return x*x + y*y;
};
/**
+ * Alias for {@link vec2.squaredDistance}
+ * @function
+ */
+vec2.sqrDist = vec2.squaredDistance;
+
+/**
* Caclulates the length of a vec2
*
* @param {vec2} a vector to calculate length of
* @returns {Number} length of a
*/
-vec2.len = vec2.length = function (a) {
+vec2.length = function (a) {
var x = a[0],
y = a[1];
return Math.sqrt(x*x + y*y);
};
/**
+ * Alias for {@link vec2.length}
+ * @function
+ */
+vec2.len = vec2.length;
+
+/**
* Caclulates the squared length of a vec2
*
* @param {vec2} a vector to calculate squared length of
* @returns {Number} squared length of a
*/
-vec2.sqrLen = vec2.squaredLength = function (a) {
+vec2.squaredLength = function (a) {
var x = a[0],
y = a[1];
return x*x + y*y;
};
/**
+ * Alias for {@link vec2.squaredLength}
+ * @function
+ */
+vec2.sqrLen = vec2.squaredLength;
+
+/**
* Negates the components of a vec2
*
* @param {vec2} out the receiving vector
@@ -344,6 +386,7 @@ vec2.transformMat2 = function(out, a, m) {
* @param {Function} fn Function to call for each vector in the array
* @param {Object} [arg] additional argument to pass to fn
* @returns {Array} a
+ * @function
*/
vec2.forEach = (function() {
var vec = new Float32Array(2);
View
57 src/gl-matrix/vec3.js
@@ -122,7 +122,7 @@ vec3.add = function(out, a, b) {
* @param {vec3} b the second operand
* @returns {vec3} out
*/
-vec3.sub = vec3.subtract = function(out, a, b) {
+vec3.subtract = function(out, a, b) {
out[0] = a[0] - b[0];
out[1] = a[1] - b[1];
out[2] = a[2] - b[2];
@@ -130,6 +130,12 @@ vec3.sub = vec3.subtract = function(out, a, b) {
};
/**
+ * Alias for {@link vec3.subtract}
+ * @function
+ */
+vec3.sub = vec3.subtract;
+
+/**
* Multiplies two vec3's
*
* @param {vec3} out the receiving vector
@@ -137,7 +143,7 @@ vec3.sub = vec3.subtract = function(out, a, b) {
* @param {vec3} b the second operand
* @returns {vec3} out
*/
-vec3.mul = vec3.multiply = function(out, a, b) {
+vec3.multiply = function(out, a, b) {
out[0] = a[0] * b[0];
out[1] = a[1] * b[1];
out[2] = a[2] * b[2];
@@ -145,6 +151,12 @@ vec3.mul = vec3.multiply = function(out, a, b) {
};
/**
+ * Alias for {@link vec3.multiply}
+ * @function
+ */
+vec3.mul = vec3.multiply;
+
+/**
* Divides two vec3's
*
* @param {vec3} out the receiving vector
@@ -152,7 +164,7 @@ vec3.mul = vec3.multiply = function(out, a, b) {
* @param {vec3} b the second operand
* @returns {vec3} out
*/
-vec3.div = vec3.divide = function(out, a, b) {
+vec3.divide = function(out, a, b) {
out[0] = a[0] / b[0];
out[1] = a[1] / b[1];
out[2] = a[2] / b[2];
@@ -160,6 +172,12 @@ vec3.div = vec3.divide = function(out, a, b) {
};
/**
+ * Alias for {@link vec3.divide}
+ * @function
+ */
+vec3.div = vec3.divide;
+
+/**
* Returns the minimum of two vec3's
*
* @param {vec3} out the receiving vector
@@ -211,7 +229,7 @@ vec3.scale = function(out, a, b) {
* @param {vec3} b the second operand
* @returns {Number} distance between a and b
*/
-vec3.dist = vec3.distance = function(a, b) {
+vec3.distance = function(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1],
z = b[2] - a[2];
@@ -219,13 +237,19 @@ vec3.dist = vec3.distance = function(a, b) {
};
/**
+ * Alias for {@link vec3.distance}
+ * @function
+ */
+vec3.dist = vec3.distance;
+
+/**
* Calculates the squared euclidian distance between two vec3's
*
* @param {vec3} a the first operand
* @param {vec3} b the second operand
* @returns {Number} squared distance between a and b
*/
-vec3.sqrDist = vec3.squaredDistance = function(a, b) {
+vec3.squaredDistance = function(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1],
z = b[2] - a[2];
@@ -233,12 +257,18 @@ vec3.sqrDist = vec3.squaredDistance = function(a, b) {
};
/**
+ * Alias for {@link vec3.squaredDistance}
+ * @function
+ */
+vec3.sqrDist = vec3.squaredDistance;
+
+/**
* Caclulates the length of a vec3
*
* @param {vec3} a vector to calculate length of
* @returns {Number} length of a
*/
-vec3.len = vec3.length = function (a) {
+vec3.length = function (a) {
var x = a[0],
y = a[1],
z = a[2];
@@ -246,12 +276,18 @@ vec3.len = vec3.length = function (a) {
};
/**
+ * Alias for {@link vec3.length}
+ * @function
+ */
+vec3.len = vec3.length;
+
+/**
* Caclulates the squared length of a vec3
*
* @param {vec3} a vector to calculate squared length of
* @returns {Number} squared length of a
*/
-vec3.sqrLen = vec3.squaredLength = function (a) {
+vec3.squaredLength = function (a) {
var x = a[0],
y = a[1],
z = a[2];
@@ -259,6 +295,12 @@ vec3.sqrLen = vec3.squaredLength = function (a) {
};
/**
+ * Alias for {@link vec3.squaredLength}
+ * @function
+ */
+vec3.sqrLen = vec3.squaredLength;
+
+/**
* Negates the components of a vec3
*
* @param {vec3} out the receiving vector
@@ -394,6 +436,7 @@ vec3.transformQuat = function(out, a, q) {
* @param {Function} fn Function to call for each vector in the array
* @param {Object} [arg] additional argument to pass to fn
* @returns {Array} a
+ * @function
*/
vec3.forEach = (function() {
var vec = new Float32Array(3);
View
57 src/gl-matrix/vec4.js
@@ -129,7 +129,7 @@ vec4.add = function(out, a, b) {
* @param {vec4} b the second operand
* @returns {vec4} out
*/
-vec4.sub = vec4.subtract = function(out, a, b) {
+vec4.subtract = function(out, a, b) {
out[0] = a[0] - b[0];
out[1] = a[1] - b[1];
out[2] = a[2] - b[2];
@@ -138,6 +138,12 @@ vec4.sub = vec4.subtract = function(out, a, b) {
};
/**
+ * Alias for {@link vec4.subtract}
+ * @function
+ */
+vec4.sub = vec4.subtract;
+
+/**
* Multiplies two vec4's
*
* @param {vec4} out the receiving vector
@@ -145,7 +151,7 @@ vec4.sub = vec4.subtract = function(out, a, b) {
* @param {vec4} b the second operand
* @returns {vec4} out
*/
-vec4.mul = vec4.multiply = function(out, a, b) {
+vec4.multiply = function(out, a, b) {
out[0] = a[0] * b[0];
out[1] = a[1] * b[1];
out[2] = a[2] * b[2];
@@ -154,6 +160,12 @@ vec4.mul = vec4.multiply = function(out, a, b) {
};
/**
+ * Alias for {@link vec4.multiply}
+ * @function
+ */
+vec4.mul = vec4.multiply;
+
+/**
* Divides two vec4's
*
* @param {vec4} out the receiving vector
@@ -161,7 +173,7 @@ vec4.mul = vec4.multiply = function(out, a, b) {
* @param {vec4} b the second operand
* @returns {vec4} out
*/
-vec4.div = vec4.divide = function(out, a, b) {
+vec4.divide = function(out, a, b) {
out[0] = a[0] / b[0];
out[1] = a[1] / b[1];
out[2] = a[2] / b[2];
@@ -170,6 +182,12 @@ vec4.div = vec4.divide = function(out, a, b) {
};
/**
+ * Alias for {@link vec4.divide}
+ * @function
+ */
+vec4.div = vec4.divide;
+
+/**
* Returns the minimum of two vec4's
*
* @param {vec4} out the receiving vector
@@ -224,7 +242,7 @@ vec4.scale = function(out, a, b) {
* @param {vec4} b the second operand
* @returns {Number} distance between a and b
*/
-vec4.dist = vec4.distance = function(a, b) {
+vec4.distance = function(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1],
z = b[2] - a[2],
@@ -233,13 +251,19 @@ vec4.dist = vec4.distance = function(a, b) {
};
/**
+ * Alias for {@link vec4.distance}
+ * @function
+ */
+vec4.dist = vec4.distance;
+
+/**
* Calculates the squared euclidian distance between two vec4's
*
* @param {vec4} a the first operand
* @param {vec4} b the second operand
* @returns {Number} squared distance between a and b
*/
-vec4.sqrDist = vec4.squaredDistance = function(a, b) {
+vec4.squaredDistance = function(a, b) {
var x = b[0] - a[0],
y = b[1] - a[1],
z = b[2] - a[2],
@@ -248,12 +272,18 @@ vec4.sqrDist = vec4.squaredDistance = function(a, b) {
};
/**
+ * Alias for {@link vec4.squaredDistance}
+ * @function
+ */
+vec4.sqrDist = vec4.squaredDistance;
+
+/**
* Caclulates the length of a vec4
*
* @param {vec4} a vector to calculate length of
* @returns {Number} length of a
*/
-vec4.len = vec4.length = function (a) {
+vec4.length = function (a) {
var x = a[0],
y = a[1],
z = a[2],
@@ -262,12 +292,18 @@ vec4.len = vec4.length = function (a) {
};
/**
+ * Alias for {@link vec4.length}
+ * @function
+ */
+vec4.len = vec4.length;
+
+/**
* Caclulates the squared length of a vec4
*
* @param {vec4} a vector to calculate squared length of
* @returns {Number} squared length of a
*/
-vec4.sqrLen = vec4.squaredLength = function (a) {
+vec4.squaredLength = function (a) {
var x = a[0],
y = a[1],
z = a[2],
@@ -276,6 +312,12 @@ vec4.sqrLen = vec4.squaredLength = function (a) {
};
/**
+ * Alias for {@link vec4.squaredLength}
+ * @function
+ */
+vec4.sqrLen = vec4.squaredLength;
+
+/**
* Negates the components of a vec4
*
* @param {vec4} out the receiving vector
@@ -397,6 +439,7 @@ vec4.transformQuat = function(out, a, q) {
* @param {Function} fn Function to call for each vector in the array
* @param {Object} [arg] additional argument to pass to fn
* @returns {Array} a
+ * @function
*/
vec4.forEach = (function() {
var vec = new Float32Array(4);
Please sign in to comment.
Something went wrong with that request. Please try again.