Lines Matching defs:vec3

25  * @name vec3
27 var vec3 = {};
30 * Creates a new, empty vec3
32 * @returns {vec3} a new 3D vector
34 vec3.create = function() {
43 * Creates a new vec3 initialized with values from an existing vector
45 * @param {vec3} a vector to clone
46 * @returns {vec3} a new 3D vector
48 vec3.clone = function(a) {
57 * Creates a new vec3 initialized with the given values
62 * @returns {vec3} a new 3D vector
64 vec3.fromValues = function(x, y, z) {
73 * Copy the values from one vec3 to another
75 * @param {vec3} out the receiving vector
76 * @param {vec3} a the source vector
77 * @returns {vec3} out
79 vec3.copy = function(out, a) {
87 * Set the components of a vec3 to the given values
89 * @param {vec3} out the receiving vector
93 * @returns {vec3} out
95 vec3.set = function(out, x, y, z) {
103 * Adds two vec3's
105 * @param {vec3} out the receiving vector
106 * @param {vec3} a the first operand
107 * @param {vec3} b the second operand
108 * @returns {vec3} out
110 vec3.add = function(out, a, b) {
118 * Subtracts two vec3's
120 * @param {vec3} out the receiving vector
121 * @param {vec3} a the first operand
122 * @param {vec3} b the second operand
123 * @returns {vec3} out
125 vec3.subtract = function(out, a, b) {
133 * Alias for {@link vec3.subtract}
136 vec3.sub = vec3.subtract;
139 * Multiplies two vec3's
141 * @param {vec3} out the receiving vector
142 * @param {vec3} a the first operand
143 * @param {vec3} b the second operand
144 * @returns {vec3} out
146 vec3.multiply = function(out, a, b) {
154 * Alias for {@link vec3.multiply}
157 vec3.mul = vec3.multiply;
160 * Divides two vec3's
162 * @param {vec3} out the receiving vector
163 * @param {vec3} a the first operand
164 * @param {vec3} b the second operand
165 * @returns {vec3} out
167 vec3.divide = function(out, a, b) {
175 * Alias for {@link vec3.divide}
178 vec3.div = vec3.divide;
181 * Returns the minimum of two vec3's
183 * @param {vec3} out the receiving vector
184 * @param {vec3} a the first operand
185 * @param {vec3} b the second operand
186 * @returns {vec3} out
188 vec3.min = function(out, a, b) {
196 * Returns the maximum of two vec3's
198 * @param {vec3} out the receiving vector
199 * @param {vec3} a the first operand
200 * @param {vec3} b the second operand
201 * @returns {vec3} out
203 vec3.max = function(out, a, b) {
211 * Scales a vec3 by a scalar number
213 * @param {vec3} out the receiving vector
214 * @param {vec3} a the vector to scale
216 * @returns {vec3} out
218 vec3.scale = function(out, a, b) {
226 * Calculates the euclidian distance between two vec3's
228 * @param {vec3} a the first operand
229 * @param {vec3} b the second operand
232 vec3.distance = function(a, b) {
240 * Alias for {@link vec3.distance}
243 vec3.dist = vec3.distance;
246 * Calculates the squared euclidian distance between two vec3's
248 * @param {vec3} a the first operand
249 * @param {vec3} b the second operand
252 vec3.squaredDistance = function(a, b) {
260 * Alias for {@link vec3.squaredDistance}
263 vec3.sqrDist = vec3.squaredDistance;
266 * Calculates the length of a vec3
268 * @param {vec3} a vector to calculate length of
271 vec3.length = function (a) {
279 * Alias for {@link vec3.length}
282 vec3.len = vec3.length;
285 * Calculates the squared length of a vec3
287 * @param {vec3} a vector to calculate squared length of
290 vec3.squaredLength = function (a) {
298 * Alias for {@link vec3.squaredLength}
301 vec3.sqrLen = vec3.squaredLength;
304 * Negates the components of a vec3
306 * @param {vec3} out the receiving vector
307 * @param {vec3} a vector to negate
308 * @returns {vec3} out
310 vec3.negate = function(out, a) {
318 * Normalize a vec3
320 * @param {vec3} out the receiving vector
321 * @param {vec3} a vector to normalize
322 * @returns {vec3} out
324 vec3.normalize = function(out, a) {
340 * Calculates the dot product of two vec3's
342 * @param {vec3} a the first operand
343 * @param {vec3} b the second operand
346 vec3.dot = function (a, b) {
351 * Computes the cross product of two vec3's
353 * @param {vec3} out the receiving vector
354 * @param {vec3} a the first operand
355 * @param {vec3} b the second operand
356 * @returns {vec3} out
358 vec3.cross = function(out, a, b) {
369 * Performs a linear interpolation between two vec3's
371 * @param {vec3} out the receiving vector
372 * @param {vec3} a the first operand
373 * @param {vec3} b the second operand
375 * @returns {vec3} out
377 vec3.lerp = function (out, a, b, t) {
388 * Transforms the vec3 with a mat4.
391 * @param {vec3} out the receiving vector
392 * @param {vec3} a the vector to transform
394 * @returns {vec3} out
396 vec3.transformMat4 = function(out, a, m) {
405 * Transforms the vec3 with a quat
407 * @param {vec3} out the receiving vector
408 * @param {vec3} a the vector to transform
410 * @returns {vec3} out
412 vec3.transformQuat = function(out, a, q) {
433 * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed
441 vec3.forEach = (function() {
442 var vec = vec3.create();
473 * @param {vec3} vec vector to represent as a string
476 vec3.str = function (a) {
477 return 'vec3(' + a[0] + ', ' + a[1] + ', ' + a[2] + ')';
481 exports.vec3 = vec3;