diff --git a/main.js b/main.js index f38dd9b2..7383becd 100644 --- a/main.js +++ b/main.js @@ -95,6 +95,22 @@ var bitonicSort = { ], }; +var blending = { + name: 'Blending', + description: ` + This example provides shows how to use blending in WebGPU. It draws a texture with diagonal lines + on top of a canvas with a CSS based checkerboard background. It then draws a texture with + 3 blurry circles on top the first texture with [blending settings](https://gpuweb.github.io/gpuweb/#color-target-state). + This lets you see both the effect of blending settings in WebGPU and the final result when composited on top of the canvas. + See [this article](https://webgpufundamentals.org/webgpu/lessons/webgpu-transparency.html) + for a more detailed explanation. + The presets are equivalent to the 2d canvas context's + [\`globalCompositingOperation\`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation). + `, + filename: "sample/blending", + sources: [{ path: 'main.ts' }, { path: 'texturedQuad.wgsl' }], +}; + var bundleCulling = { name: 'Bundle Culling', description: `A demonstration of using frustum culling with render bundles through indirect instanced draw calls.`, @@ -667,6 +683,7 @@ const pageCategories = [ occlusionQuery, samplerParameters, timestampQuery, + blending, }, }, // Samples that demonstrate the GPGPU functionality of WebGPU. These samples generally provide some diff --git a/main.js.map b/main.js.map index 34604679..190b2a3f 100644 --- a/main.js.map +++ b/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/sample/blending/index.html b/sample/blending/index.html new file mode 100644 index 00000000..08b54217 --- /dev/null +++ b/sample/blending/index.html @@ -0,0 +1,41 @@ + + + + + + webgpu-samples: blending + + + + + + + + diff --git a/sample/blending/main.js b/sample/blending/main.js new file mode 100644 index 00000000..7dbde604 --- /dev/null +++ b/sample/blending/main.js @@ -0,0 +1,8798 @@ +/* wgpu-matrix@3.3.0, license MIT */ +function wrapConstructor(OriginalConstructor, modifier) { + return class extends OriginalConstructor { + constructor(...args) { + super(...args); + modifier(this); + } + }; // Type assertion is necessary here +} +const ZeroArray = wrapConstructor((Array), a => a.fill(0)); + +/* + * Copyright 2022 Gregg Tavares + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +let EPSILON = 0.000001; + +/* + * Copyright 2022 Gregg Tavares + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/** + * Generates am typed API for Vec3 + */ +function getAPIImpl$5(Ctor) { + /** + * Creates a Vec2; may be called with x, y, z to set initial values. + * + * Note: Since passing in a raw JavaScript array + * is valid in all circumstances, if you want to + * force a JavaScript array into a Vec2's specified type + * it would be faster to use + * + * ``` + * const v = vec2.clone(someJSArray); + * ``` + * + * @param x - Initial x value. + * @param y - Initial y value. + * @returns the created vector + */ + function create(x = 0, y = 0) { + const newDst = new Ctor(2); + if (x !== undefined) { + newDst[0] = x; + if (y !== undefined) { + newDst[1] = y; + } + } + return newDst; + } + /** + * Creates a Vec2; may be called with x, y, z to set initial values. (same as create) + * @param x - Initial x value. + * @param y - Initial y value. + * @returns the created vector + */ + const fromValues = create; + /** + * Sets the values of a Vec2 + * Also see {@link vec2.create} and {@link vec2.copy} + * + * @param x first value + * @param y second value + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector with its elements set. + */ + function set(x, y, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = x; + newDst[1] = y; + return newDst; + } + /** + * Applies Math.ceil to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the ceil of each element of v. + */ + function ceil(v, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = Math.ceil(v[0]); + newDst[1] = Math.ceil(v[1]); + return newDst; + } + /** + * Applies Math.floor to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the floor of each element of v. + */ + function floor(v, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = Math.floor(v[0]); + newDst[1] = Math.floor(v[1]); + return newDst; + } + /** + * Applies Math.round to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the round of each element of v. + */ + function round(v, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = Math.round(v[0]); + newDst[1] = Math.round(v[1]); + return newDst; + } + /** + * Clamp each element of vector between min and max + * @param v - Operand vector. + * @param max - Min value, default 0 + * @param min - Max value, default 1 + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that the clamped value of each element of v. + */ + function clamp(v, min = 0, max = 1, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = Math.min(max, Math.max(min, v[0])); + newDst[1] = Math.min(max, Math.max(min, v[1])); + return newDst; + } + /** + * Adds two vectors; assumes a and b have the same dimension. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the sum of a and b. + */ + function add(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] + b[0]; + newDst[1] = a[1] + b[1]; + return newDst; + } + /** + * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension. + * @param a - Operand vector. + * @param b - Operand vector. + * @param scale - Amount to scale b + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the sum of a + b * scale. + */ + function addScaled(a, b, scale, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] + b[0] * scale; + newDst[1] = a[1] + b[1] * scale; + return newDst; + } + /** + * Returns the angle in radians between two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @returns The angle in radians between the 2 vectors. + */ + function angle(a, b) { + const ax = a[0]; + const ay = a[1]; + const bx = b[0]; + const by = b[1]; + const mag1 = Math.sqrt(ax * ax + ay * ay); + const mag2 = Math.sqrt(bx * bx + by * by); + const mag = mag1 * mag2; + const cosine = mag && dot(a, b) / mag; + return Math.acos(cosine); + } + /** + * Subtracts two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the difference of a and b. + */ + function subtract(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] - b[0]; + newDst[1] = a[1] - b[1]; + return newDst; + } + /** + * Subtracts two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the difference of a and b. + */ + const sub = subtract; + /** + * Check if 2 vectors are approximately equal + * @param a - Operand vector. + * @param b - Operand vector. + * @returns true if vectors are approximately equal + */ + function equalsApproximately(a, b) { + return Math.abs(a[0] - b[0]) < EPSILON && + Math.abs(a[1] - b[1]) < EPSILON; + } + /** + * Check if 2 vectors are exactly equal + * @param a - Operand vector. + * @param b - Operand vector. + * @returns true if vectors are exactly equal + */ + function equals(a, b) { + return a[0] === b[0] && a[1] === b[1]; + } + /** + * Performs linear interpolation on two vectors. + * Given vectors a and b and interpolation coefficient t, returns + * a + t * (b - a). + * @param a - Operand vector. + * @param b - Operand vector. + * @param t - Interpolation coefficient. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The linear interpolated result. + */ + function lerp(a, b, t, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] + t * (b[0] - a[0]); + newDst[1] = a[1] + t * (b[1] - a[1]); + return newDst; + } + /** + * Performs linear interpolation on two vectors. + * Given vectors a and b and interpolation coefficient vector t, returns + * a + t * (b - a). + * @param a - Operand vector. + * @param b - Operand vector. + * @param t - Interpolation coefficients vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns the linear interpolated result. + */ + function lerpV(a, b, t, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] + t[0] * (b[0] - a[0]); + newDst[1] = a[1] + t[1] * (b[1] - a[1]); + return newDst; + } + /** + * Return max values of two vectors. + * Given vectors a and b returns + * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])]. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The max components vector. + */ + function max(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = Math.max(a[0], b[0]); + newDst[1] = Math.max(a[1], b[1]); + return newDst; + } + /** + * Return min values of two vectors. + * Given vectors a and b returns + * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])]. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The min components vector. + */ + function min(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = Math.min(a[0], b[0]); + newDst[1] = Math.min(a[1], b[1]); + return newDst; + } + /** + * Multiplies a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + function mulScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = v[0] * k; + newDst[1] = v[1] * k; + return newDst; + } + /** + * Multiplies a vector by a scalar. (same as mulScalar) + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + const scale = mulScalar; + /** + * Divides a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + function divScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = v[0] / k; + newDst[1] = v[1] / k; + return newDst; + } + /** + * Inverse a vector. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The inverted vector. + */ + function inverse(v, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = 1 / v[0]; + newDst[1] = 1 / v[1]; + return newDst; + } + /** + * Invert a vector. (same as inverse) + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The inverted vector. + */ + const invert = inverse; + /** + * Computes the cross product of two vectors; assumes both vectors have + * three entries. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of a cross b. + */ + function cross(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + const z = a[0] * b[1] - a[1] * b[0]; + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = z; + return newDst; + } + /** + * Computes the dot product of two vectors; assumes both vectors have + * three entries. + * @param a - Operand vector. + * @param b - Operand vector. + * @returns dot product + */ + function dot(a, b) { + return a[0] * b[0] + a[1] * b[1]; + } + /** + * Computes the length of vector + * @param v - vector. + * @returns length of vector. + */ + function length(v) { + const v0 = v[0]; + const v1 = v[1]; + return Math.sqrt(v0 * v0 + v1 * v1); + } + /** + * Computes the length of vector (same as length) + * @param v - vector. + * @returns length of vector. + */ + const len = length; + /** + * Computes the square of the length of vector + * @param v - vector. + * @returns square of the length of vector. + */ + function lengthSq(v) { + const v0 = v[0]; + const v1 = v[1]; + return v0 * v0 + v1 * v1; + } + /** + * Computes the square of the length of vector (same as lengthSq) + * @param v - vector. + * @returns square of the length of vector. + */ + const lenSq = lengthSq; + /** + * Computes the distance between 2 points + * @param a - vector. + * @param b - vector. + * @returns distance between a and b + */ + function distance(a, b) { + const dx = a[0] - b[0]; + const dy = a[1] - b[1]; + return Math.sqrt(dx * dx + dy * dy); + } + /** + * Computes the distance between 2 points (same as distance) + * @param a - vector. + * @param b - vector. + * @returns distance between a and b + */ + const dist = distance; + /** + * Computes the square of the distance between 2 points + * @param a - vector. + * @param b - vector. + * @returns square of the distance between a and b + */ + function distanceSq(a, b) { + const dx = a[0] - b[0]; + const dy = a[1] - b[1]; + return dx * dx + dy * dy; + } + /** + * Computes the square of the distance between 2 points (same as distanceSq) + * @param a - vector. + * @param b - vector. + * @returns square of the distance between a and b + */ + const distSq = distanceSq; + /** + * Divides a vector by its Euclidean length and returns the quotient. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The normalized vector. + */ + function normalize(v, dst) { + const newDst = (dst ?? new Ctor(2)); + const v0 = v[0]; + const v1 = v[1]; + const len = Math.sqrt(v0 * v0 + v1 * v1); + if (len > 0.00001) { + newDst[0] = v0 / len; + newDst[1] = v1 / len; + } + else { + newDst[0] = 0; + newDst[1] = 0; + } + return newDst; + } + /** + * Negates a vector. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns -v. + */ + function negate(v, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = -v[0]; + newDst[1] = -v[1]; + return newDst; + } + /** + * Copies a vector. (same as {@link vec2.clone}) + * Also see {@link vec2.create} and {@link vec2.set} + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A copy of v. + */ + function copy(v, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = v[0]; + newDst[1] = v[1]; + return newDst; + } + /** + * Clones a vector. (same as {@link vec2.copy}) + * Also see {@link vec2.create} and {@link vec2.set} + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A copy of v. + */ + const clone = copy; + /** + * Multiplies a vector by another vector (component-wise); assumes a and + * b have the same length. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of products of entries of a and b. + */ + function multiply(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] * b[0]; + newDst[1] = a[1] * b[1]; + return newDst; + } + /** + * Multiplies a vector by another vector (component-wise); assumes a and + * b have the same length. (same as mul) + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of products of entries of a and b. + */ + const mul = multiply; + /** + * Divides a vector by another vector (component-wise); assumes a and + * b have the same length. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of quotients of entries of a and b. + */ + function divide(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = a[0] / b[0]; + newDst[1] = a[1] / b[1]; + return newDst; + } + /** + * Divides a vector by another vector (component-wise); assumes a and + * b have the same length. (same as divide) + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of quotients of entries of a and b. + */ + const div = divide; + /** + * Creates a random unit vector * scale + * @param scale - Default 1 + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The random vector. + */ + function random(scale = 1, dst) { + const newDst = (dst ?? new Ctor(2)); + const angle = Math.random() * 2 * Math.PI; + newDst[0] = Math.cos(angle) * scale; + newDst[1] = Math.sin(angle) * scale; + return newDst; + } + /** + * Zero's a vector + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The zeroed vector. + */ + function zero(dst) { + const newDst = (dst ?? new Ctor(2)); + newDst[0] = 0; + newDst[1] = 0; + return newDst; + } + /** + * transform Vec2 by 4x4 matrix + * @param v - the vector + * @param m - The matrix. + * @param dst - optional Vec2 to store result. If not passed a new one is created. + * @returns the transformed vector + */ + function transformMat4(v, m, dst) { + const newDst = (dst ?? new Ctor(2)); + const x = v[0]; + const y = v[1]; + newDst[0] = x * m[0] + y * m[4] + m[12]; + newDst[1] = x * m[1] + y * m[5] + m[13]; + return newDst; + } + /** + * Transforms vec4 by 3x3 matrix + * + * @param v - the vector + * @param m - The matrix. + * @param dst - optional Vec2 to store result. If not passed a new one is created. + * @returns the transformed vector + */ + function transformMat3(v, m, dst) { + const newDst = (dst ?? new Ctor(2)); + const x = v[0]; + const y = v[1]; + newDst[0] = m[0] * x + m[4] * y + m[8]; + newDst[1] = m[1] * x + m[5] * y + m[9]; + return newDst; + } + /** + * Rotate a 2D vector + * + * @param a The vec2 point to rotate + * @param b The origin of the rotation + * @param rad The angle of rotation in radians + * @returns the rotated vector + */ + function rotate(a, b, rad, dst) { + const newDst = (dst ?? new Ctor(2)); + // Translate point to the origin + const p0 = a[0] - b[0]; + const p1 = a[1] - b[1]; + const sinC = Math.sin(rad); + const cosC = Math.cos(rad); + //perform rotation and translate to correct position + newDst[0] = p0 * cosC - p1 * sinC + b[0]; + newDst[1] = p0 * sinC + p1 * cosC + b[1]; + return newDst; + } + /** + * Treat a 2D vector as a direction and set it's length + * + * @param a The vec2 to lengthen + * @param len The length of the resulting vector + * @returns The lengthened vector + */ + function setLength(a, len, dst) { + const newDst = (dst ?? new Ctor(2)); + normalize(a, newDst); + return mulScalar(newDst, len, newDst); + } + /** + * Ensure a vector is not longer than a max length + * + * @param a The vec2 to limit + * @param maxLen The longest length of the resulting vector + * @returns The vector, shortened to maxLen if it's too long + */ + function truncate(a, maxLen, dst) { + const newDst = (dst ?? new Ctor(2)); + if (length(a) > maxLen) { + return setLength(a, maxLen, newDst); + } + return copy(a, newDst); + } + /** + * Return the vector exactly between 2 endpoint vectors + * + * @param a Endpoint 1 + * @param b Endpoint 2 + * @returns The vector exactly residing between endpoints 1 and 2 + */ + function midpoint(a, b, dst) { + const newDst = (dst ?? new Ctor(2)); + return lerp(a, b, 0.5, newDst); + } + return { + create, + fromValues, + set, + ceil, + floor, + round, + clamp, + add, + addScaled, + angle, + subtract, + sub, + equalsApproximately, + equals, + lerp, + lerpV, + max, + min, + mulScalar, + scale, + divScalar, + inverse, + invert, + cross, + dot, + length, + len, + lengthSq, + lenSq, + distance, + dist, + distanceSq, + distSq, + normalize, + negate, + copy, + clone, + multiply, + mul, + divide, + div, + random, + zero, + transformMat4, + transformMat3, + rotate, + setLength, + truncate, + midpoint, + }; +} +const cache$5 = new Map(); +function getAPI$5(Ctor) { + let api = cache$5.get(Ctor); + if (!api) { + api = getAPIImpl$5(Ctor); + cache$5.set(Ctor, api); + } + return api; +} + +/* + * Copyright 2022 Gregg Tavares + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/** + * Generates am typed API for Vec3 + * */ +function getAPIImpl$4(Ctor) { + /** + * Creates a vec3; may be called with x, y, z to set initial values. + * @param x - Initial x value. + * @param y - Initial y value. + * @param z - Initial z value. + * @returns the created vector + */ + function create(x, y, z) { + const newDst = new Ctor(3); + if (x !== undefined) { + newDst[0] = x; + if (y !== undefined) { + newDst[1] = y; + if (z !== undefined) { + newDst[2] = z; + } + } + } + return newDst; + } + /** + * Creates a vec3; may be called with x, y, z to set initial values. (same as create) + * @param x - Initial x value. + * @param y - Initial y value. + * @param z - Initial z value. + * @returns the created vector + */ + const fromValues = create; + /** + * Sets the values of a Vec3 + * Also see {@link vec3.create} and {@link vec3.copy} + * + * @param x first value + * @param y second value + * @param z third value + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector with its elements set. + */ + function set(x, y, z, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = x; + newDst[1] = y; + newDst[2] = z; + return newDst; + } + /** + * Applies Math.ceil to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the ceil of each element of v. + */ + function ceil(v, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = Math.ceil(v[0]); + newDst[1] = Math.ceil(v[1]); + newDst[2] = Math.ceil(v[2]); + return newDst; + } + /** + * Applies Math.floor to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the floor of each element of v. + */ + function floor(v, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = Math.floor(v[0]); + newDst[1] = Math.floor(v[1]); + newDst[2] = Math.floor(v[2]); + return newDst; + } + /** + * Applies Math.round to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the round of each element of v. + */ + function round(v, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = Math.round(v[0]); + newDst[1] = Math.round(v[1]); + newDst[2] = Math.round(v[2]); + return newDst; + } + /** + * Clamp each element of vector between min and max + * @param v - Operand vector. + * @param max - Min value, default 0 + * @param min - Max value, default 1 + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that the clamped value of each element of v. + */ + function clamp(v, min = 0, max = 1, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = Math.min(max, Math.max(min, v[0])); + newDst[1] = Math.min(max, Math.max(min, v[1])); + newDst[2] = Math.min(max, Math.max(min, v[2])); + return newDst; + } + /** + * Adds two vectors; assumes a and b have the same dimension. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the sum of a and b. + */ + function add(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] + b[0]; + newDst[1] = a[1] + b[1]; + newDst[2] = a[2] + b[2]; + return newDst; + } + /** + * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension. + * @param a - Operand vector. + * @param b - Operand vector. + * @param scale - Amount to scale b + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the sum of a + b * scale. + */ + function addScaled(a, b, scale, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] + b[0] * scale; + newDst[1] = a[1] + b[1] * scale; + newDst[2] = a[2] + b[2] * scale; + return newDst; + } + /** + * Returns the angle in radians between two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @returns The angle in radians between the 2 vectors. + */ + function angle(a, b) { + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const bx = b[0]; + const by = b[1]; + const bz = b[2]; + const mag1 = Math.sqrt(ax * ax + ay * ay + az * az); + const mag2 = Math.sqrt(bx * bx + by * by + bz * bz); + const mag = mag1 * mag2; + const cosine = mag && dot(a, b) / mag; + return Math.acos(cosine); + } + /** + * Subtracts two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the difference of a and b. + */ + function subtract(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] - b[0]; + newDst[1] = a[1] - b[1]; + newDst[2] = a[2] - b[2]; + return newDst; + } + /** + * Subtracts two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the difference of a and b. + */ + const sub = subtract; + /** + * Check if 2 vectors are approximately equal + * @param a - Operand vector. + * @param b - Operand vector. + * @returns true if vectors are approximately equal + */ + function equalsApproximately(a, b) { + return Math.abs(a[0] - b[0]) < EPSILON && + Math.abs(a[1] - b[1]) < EPSILON && + Math.abs(a[2] - b[2]) < EPSILON; + } + /** + * Check if 2 vectors are exactly equal + * @param a - Operand vector. + * @param b - Operand vector. + * @returns true if vectors are exactly equal + */ + function equals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; + } + /** + * Performs linear interpolation on two vectors. + * Given vectors a and b and interpolation coefficient t, returns + * a + t * (b - a). + * @param a - Operand vector. + * @param b - Operand vector. + * @param t - Interpolation coefficient. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The linear interpolated result. + */ + function lerp(a, b, t, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] + t * (b[0] - a[0]); + newDst[1] = a[1] + t * (b[1] - a[1]); + newDst[2] = a[2] + t * (b[2] - a[2]); + return newDst; + } + /** + * Performs linear interpolation on two vectors. + * Given vectors a and b and interpolation coefficient vector t, returns + * a + t * (b - a). + * @param a - Operand vector. + * @param b - Operand vector. + * @param t - Interpolation coefficients vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns the linear interpolated result. + */ + function lerpV(a, b, t, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] + t[0] * (b[0] - a[0]); + newDst[1] = a[1] + t[1] * (b[1] - a[1]); + newDst[2] = a[2] + t[2] * (b[2] - a[2]); + return newDst; + } + /** + * Return max values of two vectors. + * Given vectors a and b returns + * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])]. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The max components vector. + */ + function max(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = Math.max(a[0], b[0]); + newDst[1] = Math.max(a[1], b[1]); + newDst[2] = Math.max(a[2], b[2]); + return newDst; + } + /** + * Return min values of two vectors. + * Given vectors a and b returns + * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])]. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The min components vector. + */ + function min(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = Math.min(a[0], b[0]); + newDst[1] = Math.min(a[1], b[1]); + newDst[2] = Math.min(a[2], b[2]); + return newDst; + } + /** + * Multiplies a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + function mulScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = v[0] * k; + newDst[1] = v[1] * k; + newDst[2] = v[2] * k; + return newDst; + } + /** + * Multiplies a vector by a scalar. (same as mulScalar) + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + const scale = mulScalar; + /** + * Divides a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + function divScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = v[0] / k; + newDst[1] = v[1] / k; + newDst[2] = v[2] / k; + return newDst; + } + /** + * Inverse a vector. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The inverted vector. + */ + function inverse(v, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = 1 / v[0]; + newDst[1] = 1 / v[1]; + newDst[2] = 1 / v[2]; + return newDst; + } + /** + * Invert a vector. (same as inverse) + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The inverted vector. + */ + const invert = inverse; + /** + * Computes the cross product of two vectors; assumes both vectors have + * three entries. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of a cross b. + */ + function cross(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + const t1 = a[2] * b[0] - a[0] * b[2]; + const t2 = a[0] * b[1] - a[1] * b[0]; + newDst[0] = a[1] * b[2] - a[2] * b[1]; + newDst[1] = t1; + newDst[2] = t2; + return newDst; + } + /** + * Computes the dot product of two vectors; assumes both vectors have + * three entries. + * @param a - Operand vector. + * @param b - Operand vector. + * @returns dot product + */ + function dot(a, b) { + return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]); + } + /** + * Computes the length of vector + * @param v - vector. + * @returns length of vector. + */ + function length(v) { + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2); + } + /** + * Computes the length of vector (same as length) + * @param v - vector. + * @returns length of vector. + */ + const len = length; + /** + * Computes the square of the length of vector + * @param v - vector. + * @returns square of the length of vector. + */ + function lengthSq(v) { + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + return v0 * v0 + v1 * v1 + v2 * v2; + } + /** + * Computes the square of the length of vector (same as lengthSq) + * @param v - vector. + * @returns square of the length of vector. + */ + const lenSq = lengthSq; + /** + * Computes the distance between 2 points + * @param a - vector. + * @param b - vector. + * @returns distance between a and b + */ + function distance(a, b) { + const dx = a[0] - b[0]; + const dy = a[1] - b[1]; + const dz = a[2] - b[2]; + return Math.sqrt(dx * dx + dy * dy + dz * dz); + } + /** + * Computes the distance between 2 points (same as distance) + * @param a - vector. + * @param b - vector. + * @returns distance between a and b + */ + const dist = distance; + /** + * Computes the square of the distance between 2 points + * @param a - vector. + * @param b - vector. + * @returns square of the distance between a and b + */ + function distanceSq(a, b) { + const dx = a[0] - b[0]; + const dy = a[1] - b[1]; + const dz = a[2] - b[2]; + return dx * dx + dy * dy + dz * dz; + } + /** + * Computes the square of the distance between 2 points (same as distanceSq) + * @param a - vector. + * @param b - vector. + * @returns square of the distance between a and b + */ + const distSq = distanceSq; + /** + * Divides a vector by its Euclidean length and returns the quotient. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The normalized vector. + */ + function normalize(v, dst) { + const newDst = (dst ?? new Ctor(3)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2); + if (len > 0.00001) { + newDst[0] = v0 / len; + newDst[1] = v1 / len; + newDst[2] = v2 / len; + } + else { + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + } + return newDst; + } + /** + * Negates a vector. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns -v. + */ + function negate(v, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = -v[0]; + newDst[1] = -v[1]; + newDst[2] = -v[2]; + return newDst; + } + /** + * Copies a vector. (same as {@link vec3.clone}) + * Also see {@link vec3.create} and {@link vec3.set} + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A copy of v. + */ + function copy(v, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = v[0]; + newDst[1] = v[1]; + newDst[2] = v[2]; + return newDst; + } + /** + * Clones a vector. (same as {@link vec3.copy}) + * Also see {@link vec3.create} and {@link vec3.set} + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A copy of v. + */ + const clone = copy; + /** + * Multiplies a vector by another vector (component-wise); assumes a and + * b have the same length. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of products of entries of a and b. + */ + function multiply(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] * b[0]; + newDst[1] = a[1] * b[1]; + newDst[2] = a[2] * b[2]; + return newDst; + } + /** + * Multiplies a vector by another vector (component-wise); assumes a and + * b have the same length. (same as mul) + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of products of entries of a and b. + */ + const mul = multiply; + /** + * Divides a vector by another vector (component-wise); assumes a and + * b have the same length. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of quotients of entries of a and b. + */ + function divide(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = a[0] / b[0]; + newDst[1] = a[1] / b[1]; + newDst[2] = a[2] / b[2]; + return newDst; + } + /** + * Divides a vector by another vector (component-wise); assumes a and + * b have the same length. (same as divide) + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of quotients of entries of a and b. + */ + const div = divide; + /** + * Creates a random vector + * @param scale - Default 1 + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The random vector. + */ + function random(scale = 1, dst) { + const newDst = (dst ?? new Ctor(3)); + const angle = Math.random() * 2 * Math.PI; + const z = Math.random() * 2 - 1; + const zScale = Math.sqrt(1 - z * z) * scale; + newDst[0] = Math.cos(angle) * zScale; + newDst[1] = Math.sin(angle) * zScale; + newDst[2] = z * scale; + return newDst; + } + /** + * Zero's a vector + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The zeroed vector. + */ + function zero(dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + return newDst; + } + /** + * transform vec3 by 4x4 matrix + * @param v - the vector + * @param m - The matrix. + * @param dst - optional vec3 to store result. If not passed a new one is created. + * @returns the transformed vector + */ + function transformMat4(v, m, dst) { + const newDst = (dst ?? new Ctor(3)); + const x = v[0]; + const y = v[1]; + const z = v[2]; + const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1; + newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; + newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; + newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; + return newDst; + } + /** + * Transform vec3 by upper 3x3 matrix inside 4x4 matrix. + * @param v - The direction. + * @param m - The matrix. + * @param dst - optional vec3 to store result. If not passed a new one is created. + * @returns The transformed vector. + */ + function transformMat4Upper3x3(v, m, dst) { + const newDst = (dst ?? new Ctor(3)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0]; + newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1]; + newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2]; + return newDst; + } + /** + * Transforms vec3 by 3x3 matrix + * + * @param v - the vector + * @param m - The matrix. + * @param dst - optional vec3 to store result. If not passed a new one is created. + * @returns the transformed vector + */ + function transformMat3(v, m, dst) { + const newDst = (dst ?? new Ctor(3)); + const x = v[0]; + const y = v[1]; + const z = v[2]; + newDst[0] = x * m[0] + y * m[4] + z * m[8]; + newDst[1] = x * m[1] + y * m[5] + z * m[9]; + newDst[2] = x * m[2] + y * m[6] + z * m[10]; + return newDst; + } + /** + * Transforms vec3 by Quaternion + * @param v - the vector to transform + * @param q - the quaternion to transform by + * @param dst - optional vec3 to store result. If not passed a new one is created. + * @returns the transformed + */ + function transformQuat(v, q, dst) { + const newDst = (dst ?? new Ctor(3)); + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const w2 = q[3] * 2; + const x = v[0]; + const y = v[1]; + const z = v[2]; + const uvX = qy * z - qz * y; + const uvY = qz * x - qx * z; + const uvZ = qx * y - qy * x; + newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2; + newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2; + newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2; + return newDst; + } + /** + * Returns the translation component of a 4-by-4 matrix as a vector with 3 + * entries. + * @param m - The matrix. + * @param dst - vector to hold result. If not passed a new one is created. + * @returns The translation component of m. + */ + function getTranslation(m, dst) { + const newDst = (dst ?? new Ctor(3)); + newDst[0] = m[12]; + newDst[1] = m[13]; + newDst[2] = m[14]; + return newDst; + } + /** + * Returns an axis of a 4x4 matrix as a vector with 3 entries + * @param m - The matrix. + * @param axis - The axis 0 = x, 1 = y, 2 = z; + * @returns The axis component of m. + */ + function getAxis(m, axis, dst) { + const newDst = (dst ?? new Ctor(3)); + const off = axis * 4; + newDst[0] = m[off + 0]; + newDst[1] = m[off + 1]; + newDst[2] = m[off + 2]; + return newDst; + } + /** + * Returns the scaling component of the matrix + * @param m - The Matrix + * @param dst - The vector to set. If not passed a new one is created. + */ + function getScaling(m, dst) { + const newDst = (dst ?? new Ctor(3)); + const xx = m[0]; + const xy = m[1]; + const xz = m[2]; + const yx = m[4]; + const yy = m[5]; + const yz = m[6]; + const zx = m[8]; + const zy = m[9]; + const zz = m[10]; + newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz); + newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz); + newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz); + return newDst; + } + /** + * Rotate a 3D vector around the x-axis + * + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @param dst - The vector to set. If not passed a new one is created. + * @returns the rotated vector + */ + function rotateX(a, b, rad, dst) { + const newDst = (dst ?? new Ctor(3)); + const p = []; + const r = []; + //Translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; + //perform rotation + r[0] = p[0]; + r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); + r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); + //translate to correct position + newDst[0] = r[0] + b[0]; + newDst[1] = r[1] + b[1]; + newDst[2] = r[2] + b[2]; + return newDst; + } + /** + * Rotate a 3D vector around the y-axis + * + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @param dst - The vector to set. If not passed a new one is created. + * @returns the rotated vector + */ + function rotateY(a, b, rad, dst) { + const newDst = (dst ?? new Ctor(3)); + const p = []; + const r = []; + // translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; + // perform rotation + r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); + r[1] = p[1]; + r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); + // translate to correct position + newDst[0] = r[0] + b[0]; + newDst[1] = r[1] + b[1]; + newDst[2] = r[2] + b[2]; + return newDst; + } + /** + * Rotate a 3D vector around the z-axis + * + * @param {ReadonlyVec3} a The vec3 point to rotate + * @param {ReadonlyVec3} b The origin of the rotation + * @param {Number} rad The angle of rotation in radians + * @param dst - The vector to set. If not passed a new one is created. + * @returns {vec3} out + */ + function rotateZ(a, b, rad, dst) { + const newDst = (dst ?? new Ctor(3)); + const p = []; + const r = []; + // translate point to the origin + p[0] = a[0] - b[0]; + p[1] = a[1] - b[1]; + p[2] = a[2] - b[2]; + // perform rotation + r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); + r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); + r[2] = p[2]; + // translate to correct position + newDst[0] = r[0] + b[0]; + newDst[1] = r[1] + b[1]; + newDst[2] = r[2] + b[2]; + return newDst; + } + /** + * Treat a 3D vector as a direction and set it's length + * + * @param a The vec3 to lengthen + * @param len The length of the resulting vector + * @returns The lengthened vector + */ + function setLength(a, len, dst) { + const newDst = (dst ?? new Ctor(3)); + normalize(a, newDst); + return mulScalar(newDst, len, newDst); + } + /** + * Ensure a vector is not longer than a max length + * + * @param a The vec3 to limit + * @param maxLen The longest length of the resulting vector + * @returns The vector, shortened to maxLen if it's too long + */ + function truncate(a, maxLen, dst) { + const newDst = (dst ?? new Ctor(3)); + if (length(a) > maxLen) { + return setLength(a, maxLen, newDst); + } + return copy(a, newDst); + } + /** + * Return the vector exactly between 2 endpoint vectors + * + * @param a Endpoint 1 + * @param b Endpoint 2 + * @returns The vector exactly residing between endpoints 1 and 2 + */ + function midpoint(a, b, dst) { + const newDst = (dst ?? new Ctor(3)); + return lerp(a, b, 0.5, newDst); + } + return { + create, + fromValues, + set, + ceil, + floor, + round, + clamp, + add, + addScaled, + angle, + subtract, + sub, + equalsApproximately, + equals, + lerp, + lerpV, + max, + min, + mulScalar, + scale, + divScalar, + inverse, + invert, + cross, + dot, + length, + len, + lengthSq, + lenSq, + distance, + dist, + distanceSq, + distSq, + normalize, + negate, + copy, + clone, + multiply, + mul, + divide, + div, + random, + zero, + transformMat4, + transformMat4Upper3x3, + transformMat3, + transformQuat, + getTranslation, + getAxis, + getScaling, + rotateX, + rotateY, + rotateZ, + setLength, + truncate, + midpoint, + }; +} +const cache$4 = new Map(); +function getAPI$4(Ctor) { + let api = cache$4.get(Ctor); + if (!api) { + api = getAPIImpl$4(Ctor); + cache$4.set(Ctor, api); + } + return api; +} + +/* + * Copyright 2022 Gregg Tavares + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/** + * Generates a typed API for Mat3 + * */ +function getAPIImpl$3(Ctor) { + const vec2 = getAPI$5(Ctor); + const vec3 = getAPI$4(Ctor); + /** + * Create a Mat3 from values + * + * Note: Since passing in a raw JavaScript array + * is valid in all circumstances, if you want to + * force a JavaScript array into a Mat3's specified type + * it would be faster to use + * + * ``` + * const m = mat3.clone(someJSArray); + * ``` + * + * @param v0 - value for element 0 + * @param v1 - value for element 1 + * @param v2 - value for element 2 + * @param v3 - value for element 3 + * @param v4 - value for element 4 + * @param v5 - value for element 5 + * @param v6 - value for element 6 + * @param v7 - value for element 7 + * @param v8 - value for element 8 + * @returns matrix created from values. + */ + function create(v0, v1, v2, v3, v4, v5, v6, v7, v8) { + const newDst = new Ctor(12); + // to make the array homogenous + newDst[3] = 0; + newDst[7] = 0; + newDst[11] = 0; + if (v0 !== undefined) { + newDst[0] = v0; + if (v1 !== undefined) { + newDst[1] = v1; + if (v2 !== undefined) { + newDst[2] = v2; + if (v3 !== undefined) { + newDst[4] = v3; + if (v4 !== undefined) { + newDst[5] = v4; + if (v5 !== undefined) { + newDst[6] = v5; + if (v6 !== undefined) { + newDst[8] = v6; + if (v7 !== undefined) { + newDst[9] = v7; + if (v8 !== undefined) { + newDst[10] = v8; + } + } + } + } + } + } + } + } + } + return newDst; + } + /** + * Sets the values of a Mat3 + * Also see {@link mat3.create} and {@link mat3.copy} + * + * @param v0 - value for element 0 + * @param v1 - value for element 1 + * @param v2 - value for element 2 + * @param v3 - value for element 3 + * @param v4 - value for element 4 + * @param v5 - value for element 5 + * @param v6 - value for element 6 + * @param v7 - value for element 7 + * @param v8 - value for element 8 + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns Mat3 set from values. + */ + function set(v0, v1, v2, v3, v4, v5, v6, v7, v8, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = v0; + newDst[1] = v1; + newDst[2] = v2; + newDst[3] = 0; + newDst[4] = v3; + newDst[5] = v4; + newDst[6] = v5; + newDst[7] = 0; + newDst[8] = v6; + newDst[9] = v7; + newDst[10] = v8; + newDst[11] = 0; + return newDst; + } + /** + * Creates a Mat3 from the upper left 3x3 part of a Mat4 + * @param m4 - source matrix + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns Mat3 made from m4 + */ + function fromMat4(m4, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = m4[0]; + newDst[1] = m4[1]; + newDst[2] = m4[2]; + newDst[3] = 0; + newDst[4] = m4[4]; + newDst[5] = m4[5]; + newDst[6] = m4[6]; + newDst[7] = 0; + newDst[8] = m4[8]; + newDst[9] = m4[9]; + newDst[10] = m4[10]; + newDst[11] = 0; + return newDst; + } + /** + * Creates a Mat3 rotation matrix from a quaternion + * @param q - quaternion to create matrix from + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns Mat3 made from q + */ + function fromQuat(q, dst) { + const newDst = (dst ?? new Ctor(12)); + const x = q[0]; + const y = q[1]; + const z = q[2]; + const w = q[3]; + const x2 = x + x; + const y2 = y + y; + const z2 = z + z; + const xx = x * x2; + const yx = y * x2; + const yy = y * y2; + const zx = z * x2; + const zy = z * y2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + newDst[0] = 1 - yy - zz; + newDst[1] = yx + wz; + newDst[2] = zx - wy; + newDst[3] = 0; + newDst[4] = yx - wz; + newDst[5] = 1 - xx - zz; + newDst[6] = zy + wx; + newDst[7] = 0; + newDst[8] = zx + wy; + newDst[9] = zy - wx; + newDst[10] = 1 - xx - yy; + newDst[11] = 0; + return newDst; + } + /** + * Negates a matrix. + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns -m. + */ + function negate(m, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = -m[0]; + newDst[1] = -m[1]; + newDst[2] = -m[2]; + newDst[4] = -m[4]; + newDst[5] = -m[5]; + newDst[6] = -m[6]; + newDst[8] = -m[8]; + newDst[9] = -m[9]; + newDst[10] = -m[10]; + return newDst; + } + /** + * Copies a matrix. (same as {@link mat3.clone}) + * Also see {@link mat3.create} and {@link mat3.set} + * @param m - The matrix. + * @param dst - The matrix. If not passed a new one is created. + * @returns A copy of m. + */ + function copy(m, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = m[0]; + newDst[1] = m[1]; + newDst[2] = m[2]; + newDst[4] = m[4]; + newDst[5] = m[5]; + newDst[6] = m[6]; + newDst[8] = m[8]; + newDst[9] = m[9]; + newDst[10] = m[10]; + return newDst; + } + /** + * Copies a matrix (same as {@link mat3.copy}) + * Also see {@link mat3.create} and {@link mat3.set} + * @param m - The matrix. + * @param dst - The matrix. If not passed a new one is created. + * @returns A copy of m. + */ + const clone = copy; + /** + * Check if 2 matrices are approximately equal + * @param a Operand matrix. + * @param b Operand matrix. + * @returns true if matrices are approximately equal + */ + function equalsApproximately(a, b) { + return Math.abs(a[0] - b[0]) < EPSILON && + Math.abs(a[1] - b[1]) < EPSILON && + Math.abs(a[2] - b[2]) < EPSILON && + Math.abs(a[4] - b[4]) < EPSILON && + Math.abs(a[5] - b[5]) < EPSILON && + Math.abs(a[6] - b[6]) < EPSILON && + Math.abs(a[8] - b[8]) < EPSILON && + Math.abs(a[9] - b[9]) < EPSILON && + Math.abs(a[10] - b[10]) < EPSILON; + } + /** + * Check if 2 matrices are exactly equal + * @param a Operand matrix. + * @param b Operand matrix. + * @returns true if matrices are exactly equal + */ + function equals(a, b) { + return a[0] === b[0] && + a[1] === b[1] && + a[2] === b[2] && + a[4] === b[4] && + a[5] === b[5] && + a[6] === b[6] && + a[8] === b[8] && + a[9] === b[9] && + a[10] === b[10]; + } + /** + * Creates a 3-by-3 identity matrix. + * + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns A 3-by-3 identity matrix. + */ + function identity(dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + return newDst; + } + /** + * Takes the transpose of a matrix. + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The transpose of m. + */ + function transpose(m, dst) { + const newDst = (dst ?? new Ctor(12)); + if (newDst === m) { + let t; + // 0 1 2 + // 4 5 6 + // 8 9 10 + t = m[1]; + m[1] = m[4]; + m[4] = t; + t = m[2]; + m[2] = m[8]; + m[8] = t; + t = m[6]; + m[6] = m[9]; + m[9] = t; + return newDst; + } + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + newDst[0] = m00; + newDst[1] = m10; + newDst[2] = m20; + newDst[4] = m01; + newDst[5] = m11; + newDst[6] = m21; + newDst[8] = m02; + newDst[9] = m12; + newDst[10] = m22; + return newDst; + } + /** + * Computes the inverse of a 3-by-3 matrix. + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The inverse of m. + */ + function inverse(m, dst) { + const newDst = (dst ?? new Ctor(12)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const b01 = m22 * m11 - m12 * m21; + const b11 = -m22 * m10 + m12 * m20; + const b21 = m21 * m10 - m11 * m20; + const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21); + newDst[0] = b01 * invDet; + newDst[1] = (-m22 * m01 + m02 * m21) * invDet; + newDst[2] = (m12 * m01 - m02 * m11) * invDet; + newDst[4] = b11 * invDet; + newDst[5] = (m22 * m00 - m02 * m20) * invDet; + newDst[6] = (-m12 * m00 + m02 * m10) * invDet; + newDst[8] = b21 * invDet; + newDst[9] = (-m21 * m00 + m01 * m20) * invDet; + newDst[10] = (m11 * m00 - m01 * m10) * invDet; + return newDst; + } + /** + * Compute the determinant of a matrix + * @param m - the matrix + * @returns the determinant + */ + function determinant(m) { + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + return m00 * (m11 * m22 - m21 * m12) - + m10 * (m01 * m22 - m21 * m02) + + m20 * (m01 * m12 - m11 * m02); + } + /** + * Computes the inverse of a 3-by-3 matrix. (same as inverse) + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The inverse of m. + */ + const invert = inverse; + /** + * Multiplies two 3-by-3 matrices with a on the left and b on the right + * @param a - The matrix on the left. + * @param b - The matrix on the right. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The matrix product of a and b. + */ + function multiply(a, b, dst) { + const newDst = (dst ?? new Ctor(12)); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a10 = a[4 + 0]; + const a11 = a[4 + 1]; + const a12 = a[4 + 2]; + const a20 = a[8 + 0]; + const a21 = a[8 + 1]; + const a22 = a[8 + 2]; + const b00 = b[0]; + const b01 = b[1]; + const b02 = b[2]; + const b10 = b[4 + 0]; + const b11 = b[4 + 1]; + const b12 = b[4 + 2]; + const b20 = b[8 + 0]; + const b21 = b[8 + 1]; + const b22 = b[8 + 2]; + newDst[0] = a00 * b00 + a10 * b01 + a20 * b02; + newDst[1] = a01 * b00 + a11 * b01 + a21 * b02; + newDst[2] = a02 * b00 + a12 * b01 + a22 * b02; + newDst[4] = a00 * b10 + a10 * b11 + a20 * b12; + newDst[5] = a01 * b10 + a11 * b11 + a21 * b12; + newDst[6] = a02 * b10 + a12 * b11 + a22 * b12; + newDst[8] = a00 * b20 + a10 * b21 + a20 * b22; + newDst[9] = a01 * b20 + a11 * b21 + a21 * b22; + newDst[10] = a02 * b20 + a12 * b21 + a22 * b22; + return newDst; + } + /** + * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply) + * @param a - The matrix on the left. + * @param b - The matrix on the right. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The matrix product of a and b. + */ + const mul = multiply; + /** + * Sets the translation component of a 3-by-3 matrix to the given + * vector. + * @param a - The matrix. + * @param v - The vector. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The matrix with translation set. + */ + function setTranslation(a, v, dst) { + const newDst = (dst ?? identity()); + if (a !== newDst) { + newDst[0] = a[0]; + newDst[1] = a[1]; + newDst[2] = a[2]; + newDst[4] = a[4]; + newDst[5] = a[5]; + newDst[6] = a[6]; + } + newDst[8] = v[0]; + newDst[9] = v[1]; + newDst[10] = 1; + return newDst; + } + /** + * Returns the translation component of a 3-by-3 matrix as a vector with 3 + * entries. + * @param m - The matrix. + * @param dst - vector to hold result. If not passed a new one is created. + * @returns The translation component of m. + */ + function getTranslation(m, dst) { + const newDst = (dst ?? vec2.create()); + newDst[0] = m[8]; + newDst[1] = m[9]; + return newDst; + } + /** + * Returns an axis of a 3x3 matrix as a vector with 2 entries + * @param m - The matrix. + * @param axis - The axis 0 = x, 1 = y, + * @returns The axis component of m. + */ + function getAxis(m, axis, dst) { + const newDst = (dst ?? vec2.create()); + const off = axis * 4; + newDst[0] = m[off + 0]; + newDst[1] = m[off + 1]; + return newDst; + } + /** + * Sets an axis of a 3x3 matrix as a vector with 2 entries + * @param m - The matrix. + * @param v - the axis vector + * @param axis - The axis 0 = x, 1 = y; + * @param dst - The matrix to set. If not passed a new one is created. + * @returns The matrix with axis set. + */ + function setAxis(m, v, axis, dst) { + const newDst = (dst === m ? m : copy(m, dst)); + const off = axis * 4; + newDst[off + 0] = v[0]; + newDst[off + 1] = v[1]; + return newDst; + } + /** + * Returns the "2d" scaling component of the matrix + * @param m - The Matrix + * @param dst - The vector to set. If not passed a new one is created. + */ + function getScaling(m, dst) { + const newDst = (dst ?? vec2.create()); + const xx = m[0]; + const xy = m[1]; + const yx = m[4]; + const yy = m[5]; + newDst[0] = Math.sqrt(xx * xx + xy * xy); + newDst[1] = Math.sqrt(yx * yx + yy * yy); + return newDst; + } + /** + * Returns the "3d" scaling component of the matrix + * @param m - The Matrix + * @param dst - The vector to set. If not passed a new one is created. + */ + function get3DScaling(m, dst) { + const newDst = (dst ?? vec3.create()); + const xx = m[0]; + const xy = m[1]; + const xz = m[2]; + const yx = m[4]; + const yy = m[5]; + const yz = m[6]; + const zx = m[8]; + const zy = m[9]; + const zz = m[10]; + newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz); + newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz); + newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz); + return newDst; + } + /** + * Creates a 3-by-3 matrix which translates by the given vector v. + * @param v - The vector by which to translate. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The translation matrix. + */ + function translation(v, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[8] = v[0]; + newDst[9] = v[1]; + newDst[10] = 1; + return newDst; + } + /** + * Translates the given 3-by-3 matrix by the given vector v. + * @param m - The matrix. + * @param v - The vector by which to translate. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The translated matrix. + */ + function translate(m, v, dst) { + const newDst = (dst ?? new Ctor(12)); + const v0 = v[0]; + const v1 = v[1]; + const m00 = m[0]; + const m01 = m[1]; + const m02 = m[2]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + if (m !== newDst) { + newDst[0] = m00; + newDst[1] = m01; + newDst[2] = m02; + newDst[4] = m10; + newDst[5] = m11; + newDst[6] = m12; + } + newDst[8] = m00 * v0 + m10 * v1 + m20; + newDst[9] = m01 * v0 + m11 * v1 + m21; + newDst[10] = m02 * v0 + m12 * v1 + m22; + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotation(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c; + newDst[1] = s; + newDst[2] = 0; + newDst[4] = -s; + newDst[5] = c; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix by the given angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotate(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c * m00 + s * m10; + newDst[1] = c * m01 + s * m11; + newDst[2] = c * m02 + s * m12; + newDst[4] = c * m10 - s * m00; + newDst[5] = c * m11 - s * m01; + newDst[6] = c * m12 - s * m02; + if (m !== newDst) { + newDst[8] = m[8]; + newDst[9] = m[9]; + newDst[10] = m[10]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationX(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = c; + newDst[6] = s; + newDst[8] = 0; + newDst[9] = -s; + newDst[10] = c; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix around the x-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateX(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m10 = m[4]; + const m11 = m[5]; + const m12 = m[6]; + const m20 = m[8]; + const m21 = m[9]; + const m22 = m[10]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[4] = c * m10 + s * m20; + newDst[5] = c * m11 + s * m21; + newDst[6] = c * m12 + s * m22; + newDst[8] = c * m20 - s * m10; + newDst[9] = c * m21 - s * m11; + newDst[10] = c * m22 - s * m12; + if (m !== newDst) { + newDst[0] = m[0]; + newDst[1] = m[1]; + newDst[2] = m[2]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationY(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c; + newDst[1] = 0; + newDst[2] = -s; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[8] = s; + newDst[9] = 0; + newDst[10] = c; + return newDst; + } + /** + * Rotates the given 3-by-3 matrix around the y-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateY(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(12)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c * m00 - s * m20; + newDst[1] = c * m01 - s * m21; + newDst[2] = c * m02 - s * m22; + newDst[8] = c * m20 + s * m00; + newDst[9] = c * m21 + s * m01; + newDst[10] = c * m22 + s * m02; + if (m !== newDst) { + newDst[4] = m[4]; + newDst[5] = m[5]; + newDst[6] = m[6]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + const rotationZ = rotation; + /** + * Rotates the given 3-by-3 matrix around the z-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + const rotateZ = rotate; + /** + * Creates a 3-by-3 matrix which scales in each dimension by an amount given by + * the corresponding entry in the given vector; assumes the vector has two + * entries. + * @param v - A vector of + * 2 entries specifying the factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function scaling(v, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = v[0]; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = v[1]; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given by the corresponding entry in the given vector; assumes the vector has + * two entries. + * @param m - The matrix to be modified. + * @param v - A vector of 2 entries specifying the + * factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function scale(m, v, dst) { + const newDst = (dst ?? new Ctor(12)); + const v0 = v[0]; + const v1 = v[1]; + newDst[0] = v0 * m[0 * 4 + 0]; + newDst[1] = v0 * m[0 * 4 + 1]; + newDst[2] = v0 * m[0 * 4 + 2]; + newDst[4] = v1 * m[1 * 4 + 0]; + newDst[5] = v1 * m[1 * 4 + 1]; + newDst[6] = v1 * m[1 * 4 + 2]; + if (m !== newDst) { + newDst[8] = m[8]; + newDst[9] = m[9]; + newDst[10] = m[10]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which scales in each dimension by an amount given by + * the corresponding entry in the given vector; assumes the vector has three + * entries. + * @param v - A vector of + * 3 entries specifying the factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function scaling3D(v, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = v[0]; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = v[1]; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = v[2]; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given by the corresponding entry in the given vector; assumes the vector has + * three entries. + * @param m - The matrix to be modified. + * @param v - A vector of 3 entries specifying the + * factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function scale3D(m, v, dst) { + const newDst = (dst ?? new Ctor(12)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + newDst[0] = v0 * m[0 * 4 + 0]; + newDst[1] = v0 * m[0 * 4 + 1]; + newDst[2] = v0 * m[0 * 4 + 2]; + newDst[4] = v1 * m[1 * 4 + 0]; + newDst[5] = v1 * m[1 * 4 + 1]; + newDst[6] = v1 * m[1 * 4 + 2]; + newDst[8] = v2 * m[2 * 4 + 0]; + newDst[9] = v2 * m[2 * 4 + 1]; + newDst[10] = v2 * m[2 * 4 + 2]; + return newDst; + } + /** + * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions + * @param s - Amount to scale + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function uniformScaling(s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = s; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in the X and Y dimension by an amount + * given. + * @param m - The matrix to be modified. + * @param s - Amount to scale. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function uniformScale(m, s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s * m[0 * 4 + 0]; + newDst[1] = s * m[0 * 4 + 1]; + newDst[2] = s * m[0 * 4 + 2]; + newDst[4] = s * m[1 * 4 + 0]; + newDst[5] = s * m[1 * 4 + 1]; + newDst[6] = s * m[1 * 4 + 2]; + if (m !== newDst) { + newDst[8] = m[8]; + newDst[9] = m[9]; + newDst[10] = m[10]; + } + return newDst; + } + /** + * Creates a 3-by-3 matrix which scales uniformly in each dimension + * @param s - Amount to scale + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function uniformScaling3D(s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s; + newDst[1] = 0; + newDst[2] = 0; + newDst[4] = 0; + newDst[5] = s; + newDst[6] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = s; + return newDst; + } + /** + * Scales the given 3-by-3 matrix in each dimension by an amount + * given. + * @param m - The matrix to be modified. + * @param s - Amount to scale. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function uniformScale3D(m, s, dst) { + const newDst = (dst ?? new Ctor(12)); + newDst[0] = s * m[0 * 4 + 0]; + newDst[1] = s * m[0 * 4 + 1]; + newDst[2] = s * m[0 * 4 + 2]; + newDst[4] = s * m[1 * 4 + 0]; + newDst[5] = s * m[1 * 4 + 1]; + newDst[6] = s * m[1 * 4 + 2]; + newDst[8] = s * m[2 * 4 + 0]; + newDst[9] = s * m[2 * 4 + 1]; + newDst[10] = s * m[2 * 4 + 2]; + return newDst; + } + return { + clone, + create, + set, + fromMat4, + fromQuat, + negate, + copy, + equalsApproximately, + equals, + identity, + transpose, + inverse, + invert, + determinant, + mul, + multiply, + setTranslation, + getTranslation, + getAxis, + setAxis, + getScaling, + get3DScaling, + translation, + translate, + rotation, + rotate, + rotationX, + rotateX, + rotationY, + rotateY, + rotationZ, + rotateZ, + scaling, + scale, + uniformScaling, + uniformScale, + scaling3D, + scale3D, + uniformScaling3D, + uniformScale3D, + }; +} +const cache$3 = new Map(); +function getAPI$3(Ctor) { + let api = cache$3.get(Ctor); + if (!api) { + api = getAPIImpl$3(Ctor); + cache$3.set(Ctor, api); + } + return api; +} + +/** + * Generates a typed API for Mat4 + * */ +function getAPIImpl$2(Ctor) { + const vec3 = getAPI$4(Ctor); + /** + * 4x4 Matrix math math functions. + * + * Almost all functions take an optional `newDst` argument. If it is not passed in the + * functions will create a new matrix. In other words you can do this + * + * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix + * + * or + * + * const mat = mat4.create(); + * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat. + * + * The first style is often easier but depending on where it's used it generates garbage where + * as there is almost never allocation with the second style. + * + * It is always save to pass any matrix as the destination. So for example + * + * const mat = mat4.identity(); + * const trans = mat4.translation([1, 2, 3]); + * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat. + * + */ + /** + * Create a Mat4 from values + * + * Note: Since passing in a raw JavaScript array + * is valid in all circumstances, if you want to + * force a JavaScript array into a Mat4's specified type + * it would be faster to use + * + * ``` + * const m = mat4.clone(someJSArray); + * ``` + * + * @param v0 - value for element 0 + * @param v1 - value for element 1 + * @param v2 - value for element 2 + * @param v3 - value for element 3 + * @param v4 - value for element 4 + * @param v5 - value for element 5 + * @param v6 - value for element 6 + * @param v7 - value for element 7 + * @param v8 - value for element 8 + * @param v9 - value for element 9 + * @param v10 - value for element 10 + * @param v11 - value for element 11 + * @param v12 - value for element 12 + * @param v13 - value for element 13 + * @param v14 - value for element 14 + * @param v15 - value for element 15 + * @returns created from values. + */ + function create(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { + const newDst = new Ctor(16); + if (v0 !== undefined) { + newDst[0] = v0; + if (v1 !== undefined) { + newDst[1] = v1; + if (v2 !== undefined) { + newDst[2] = v2; + if (v3 !== undefined) { + newDst[3] = v3; + if (v4 !== undefined) { + newDst[4] = v4; + if (v5 !== undefined) { + newDst[5] = v5; + if (v6 !== undefined) { + newDst[6] = v6; + if (v7 !== undefined) { + newDst[7] = v7; + if (v8 !== undefined) { + newDst[8] = v8; + if (v9 !== undefined) { + newDst[9] = v9; + if (v10 !== undefined) { + newDst[10] = v10; + if (v11 !== undefined) { + newDst[11] = v11; + if (v12 !== undefined) { + newDst[12] = v12; + if (v13 !== undefined) { + newDst[13] = v13; + if (v14 !== undefined) { + newDst[14] = v14; + if (v15 !== undefined) { + newDst[15] = v15; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return newDst; + } + /** + * Sets the values of a Mat4 + * Also see {@link mat4.create} and {@link mat4.copy} + * + * @param v0 - value for element 0 + * @param v1 - value for element 1 + * @param v2 - value for element 2 + * @param v3 - value for element 3 + * @param v4 - value for element 4 + * @param v5 - value for element 5 + * @param v6 - value for element 6 + * @param v7 - value for element 7 + * @param v8 - value for element 8 + * @param v9 - value for element 9 + * @param v10 - value for element 10 + * @param v11 - value for element 11 + * @param v12 - value for element 12 + * @param v13 - value for element 13 + * @param v14 - value for element 14 + * @param v15 - value for element 15 + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns Mat4 created from values. + */ + function set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = v0; + newDst[1] = v1; + newDst[2] = v2; + newDst[3] = v3; + newDst[4] = v4; + newDst[5] = v5; + newDst[6] = v6; + newDst[7] = v7; + newDst[8] = v8; + newDst[9] = v9; + newDst[10] = v10; + newDst[11] = v11; + newDst[12] = v12; + newDst[13] = v13; + newDst[14] = v14; + newDst[15] = v15; + return newDst; + } + /** + * Creates a Mat4 from a Mat3 + * @param m3 - source matrix + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns Mat4 made from m3 + */ + function fromMat3(m3, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = m3[0]; + newDst[1] = m3[1]; + newDst[2] = m3[2]; + newDst[3] = 0; + newDst[4] = m3[4]; + newDst[5] = m3[5]; + newDst[6] = m3[6]; + newDst[7] = 0; + newDst[8] = m3[8]; + newDst[9] = m3[9]; + newDst[10] = m3[10]; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Creates a Mat4 rotation matrix from a quaternion + * @param q - quaternion to create matrix from + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns Mat4 made from q + */ + function fromQuat(q, dst) { + const newDst = (dst ?? new Ctor(16)); + const x = q[0]; + const y = q[1]; + const z = q[2]; + const w = q[3]; + const x2 = x + x; + const y2 = y + y; + const z2 = z + z; + const xx = x * x2; + const yx = y * x2; + const yy = y * y2; + const zx = z * x2; + const zy = z * y2; + const zz = z * z2; + const wx = w * x2; + const wy = w * y2; + const wz = w * z2; + newDst[0] = 1 - yy - zz; + newDst[1] = yx + wz; + newDst[2] = zx - wy; + newDst[3] = 0; + newDst[4] = yx - wz; + newDst[5] = 1 - xx - zz; + newDst[6] = zy + wx; + newDst[7] = 0; + newDst[8] = zx + wy; + newDst[9] = zy - wx; + newDst[10] = 1 - xx - yy; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Negates a matrix. + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns -m. + */ + function negate(m, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = -m[0]; + newDst[1] = -m[1]; + newDst[2] = -m[2]; + newDst[3] = -m[3]; + newDst[4] = -m[4]; + newDst[5] = -m[5]; + newDst[6] = -m[6]; + newDst[7] = -m[7]; + newDst[8] = -m[8]; + newDst[9] = -m[9]; + newDst[10] = -m[10]; + newDst[11] = -m[11]; + newDst[12] = -m[12]; + newDst[13] = -m[13]; + newDst[14] = -m[14]; + newDst[15] = -m[15]; + return newDst; + } + /** + * Copies a matrix. (same as {@link mat4.clone}) + * Also see {@link mat4.create} and {@link mat4.set} + * @param m - The matrix. + * @param dst - The matrix. If not passed a new one is created. + * @returns A copy of m. + */ + function copy(m, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = m[0]; + newDst[1] = m[1]; + newDst[2] = m[2]; + newDst[3] = m[3]; + newDst[4] = m[4]; + newDst[5] = m[5]; + newDst[6] = m[6]; + newDst[7] = m[7]; + newDst[8] = m[8]; + newDst[9] = m[9]; + newDst[10] = m[10]; + newDst[11] = m[11]; + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + return newDst; + } + /** + * Copies a matrix (same as {@link mat4.copy}) + * Also see {@link mat4.create} and {@link mat4.set} + * @param m - The matrix. + * @param dst - The matrix. If not passed a new one is created. + * @returns A copy of m. + */ + const clone = copy; + /** + * Check if 2 matrices are approximately equal + * @param a - Operand matrix. + * @param b - Operand matrix. + * @returns true if matrices are approximately equal + */ + function equalsApproximately(a, b) { + return Math.abs(a[0] - b[0]) < EPSILON && + Math.abs(a[1] - b[1]) < EPSILON && + Math.abs(a[2] - b[2]) < EPSILON && + Math.abs(a[3] - b[3]) < EPSILON && + Math.abs(a[4] - b[4]) < EPSILON && + Math.abs(a[5] - b[5]) < EPSILON && + Math.abs(a[6] - b[6]) < EPSILON && + Math.abs(a[7] - b[7]) < EPSILON && + Math.abs(a[8] - b[8]) < EPSILON && + Math.abs(a[9] - b[9]) < EPSILON && + Math.abs(a[10] - b[10]) < EPSILON && + Math.abs(a[11] - b[11]) < EPSILON && + Math.abs(a[12] - b[12]) < EPSILON && + Math.abs(a[13] - b[13]) < EPSILON && + Math.abs(a[14] - b[14]) < EPSILON && + Math.abs(a[15] - b[15]) < EPSILON; + } + /** + * Check if 2 matrices are exactly equal + * @param a - Operand matrix. + * @param b - Operand matrix. + * @returns true if matrices are exactly equal + */ + function equals(a, b) { + return a[0] === b[0] && + a[1] === b[1] && + a[2] === b[2] && + a[3] === b[3] && + a[4] === b[4] && + a[5] === b[5] && + a[6] === b[6] && + a[7] === b[7] && + a[8] === b[8] && + a[9] === b[9] && + a[10] === b[10] && + a[11] === b[11] && + a[12] === b[12] && + a[13] === b[13] && + a[14] === b[14] && + a[15] === b[15]; + } + /** + * Creates a 4-by-4 identity matrix. + * + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns A 4-by-4 identity matrix. + */ + function identity(dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Takes the transpose of a matrix. + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The transpose of m. + */ + function transpose(m, dst) { + const newDst = (dst ?? new Ctor(16)); + if (newDst === m) { + let t; + t = m[1]; + m[1] = m[4]; + m[4] = t; + t = m[2]; + m[2] = m[8]; + m[8] = t; + t = m[3]; + m[3] = m[12]; + m[12] = t; + t = m[6]; + m[6] = m[9]; + m[9] = t; + t = m[7]; + m[7] = m[13]; + m[13] = t; + t = m[11]; + m[11] = m[14]; + m[14] = t; + return newDst; + } + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m03 = m[0 * 4 + 3]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m13 = m[1 * 4 + 3]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const m23 = m[2 * 4 + 3]; + const m30 = m[3 * 4 + 0]; + const m31 = m[3 * 4 + 1]; + const m32 = m[3 * 4 + 2]; + const m33 = m[3 * 4 + 3]; + newDst[0] = m00; + newDst[1] = m10; + newDst[2] = m20; + newDst[3] = m30; + newDst[4] = m01; + newDst[5] = m11; + newDst[6] = m21; + newDst[7] = m31; + newDst[8] = m02; + newDst[9] = m12; + newDst[10] = m22; + newDst[11] = m32; + newDst[12] = m03; + newDst[13] = m13; + newDst[14] = m23; + newDst[15] = m33; + return newDst; + } + /** + * Computes the inverse of a 4-by-4 matrix. + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The inverse of m. + */ + function inverse(m, dst) { + const newDst = (dst ?? new Ctor(16)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m03 = m[0 * 4 + 3]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m13 = m[1 * 4 + 3]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const m23 = m[2 * 4 + 3]; + const m30 = m[3 * 4 + 0]; + const m31 = m[3 * 4 + 1]; + const m32 = m[3 * 4 + 2]; + const m33 = m[3 * 4 + 3]; + const tmp0 = m22 * m33; + const tmp1 = m32 * m23; + const tmp2 = m12 * m33; + const tmp3 = m32 * m13; + const tmp4 = m12 * m23; + const tmp5 = m22 * m13; + const tmp6 = m02 * m33; + const tmp7 = m32 * m03; + const tmp8 = m02 * m23; + const tmp9 = m22 * m03; + const tmp10 = m02 * m13; + const tmp11 = m12 * m03; + const tmp12 = m20 * m31; + const tmp13 = m30 * m21; + const tmp14 = m10 * m31; + const tmp15 = m30 * m11; + const tmp16 = m10 * m21; + const tmp17 = m20 * m11; + const tmp18 = m00 * m31; + const tmp19 = m30 * m01; + const tmp20 = m00 * m21; + const tmp21 = m20 * m01; + const tmp22 = m00 * m11; + const tmp23 = m10 * m01; + const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) - + (tmp1 * m11 + tmp2 * m21 + tmp5 * m31); + const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) - + (tmp0 * m01 + tmp7 * m21 + tmp8 * m31); + const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) - + (tmp3 * m01 + tmp6 * m11 + tmp11 * m31); + const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) - + (tmp4 * m01 + tmp9 * m11 + tmp10 * m21); + const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3); + newDst[0] = d * t0; + newDst[1] = d * t1; + newDst[2] = d * t2; + newDst[3] = d * t3; + newDst[4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) - + (tmp0 * m10 + tmp3 * m20 + tmp4 * m30)); + newDst[5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) - + (tmp1 * m00 + tmp6 * m20 + tmp9 * m30)); + newDst[6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) - + (tmp2 * m00 + tmp7 * m10 + tmp10 * m30)); + newDst[7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) - + (tmp5 * m00 + tmp8 * m10 + tmp11 * m20)); + newDst[8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) - + (tmp13 * m13 + tmp14 * m23 + tmp17 * m33)); + newDst[9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) - + (tmp12 * m03 + tmp19 * m23 + tmp20 * m33)); + newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) - + (tmp15 * m03 + tmp18 * m13 + tmp23 * m33)); + newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) - + (tmp16 * m03 + tmp21 * m13 + tmp22 * m23)); + newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) - + (tmp16 * m32 + tmp12 * m12 + tmp15 * m22)); + newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) - + (tmp18 * m22 + tmp21 * m32 + tmp13 * m02)); + newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) - + (tmp22 * m32 + tmp14 * m02 + tmp19 * m12)); + newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) - + (tmp20 * m12 + tmp23 * m22 + tmp17 * m02)); + return newDst; + } + /** + * Compute the determinant of a matrix + * @param m - the matrix + * @returns the determinant + */ + function determinant(m) { + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m03 = m[0 * 4 + 3]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m13 = m[1 * 4 + 3]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const m23 = m[2 * 4 + 3]; + const m30 = m[3 * 4 + 0]; + const m31 = m[3 * 4 + 1]; + const m32 = m[3 * 4 + 2]; + const m33 = m[3 * 4 + 3]; + const tmp0 = m22 * m33; + const tmp1 = m32 * m23; + const tmp2 = m12 * m33; + const tmp3 = m32 * m13; + const tmp4 = m12 * m23; + const tmp5 = m22 * m13; + const tmp6 = m02 * m33; + const tmp7 = m32 * m03; + const tmp8 = m02 * m23; + const tmp9 = m22 * m03; + const tmp10 = m02 * m13; + const tmp11 = m12 * m03; + const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) - + (tmp1 * m11 + tmp2 * m21 + tmp5 * m31); + const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) - + (tmp0 * m01 + tmp7 * m21 + tmp8 * m31); + const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) - + (tmp3 * m01 + tmp6 * m11 + tmp11 * m31); + const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) - + (tmp4 * m01 + tmp9 * m11 + tmp10 * m21); + return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3; + } + /** + * Computes the inverse of a 4-by-4 matrix. (same as inverse) + * @param m - The matrix. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The inverse of m. + */ + const invert = inverse; + /** + * Multiplies two 4-by-4 matrices with a on the left and b on the right + * @param a - The matrix on the left. + * @param b - The matrix on the right. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The matrix product of a and b. + */ + function multiply(a, b, dst) { + const newDst = (dst ?? new Ctor(16)); + const a00 = a[0]; + const a01 = a[1]; + const a02 = a[2]; + const a03 = a[3]; + const a10 = a[4 + 0]; + const a11 = a[4 + 1]; + const a12 = a[4 + 2]; + const a13 = a[4 + 3]; + const a20 = a[8 + 0]; + const a21 = a[8 + 1]; + const a22 = a[8 + 2]; + const a23 = a[8 + 3]; + const a30 = a[12 + 0]; + const a31 = a[12 + 1]; + const a32 = a[12 + 2]; + const a33 = a[12 + 3]; + const b00 = b[0]; + const b01 = b[1]; + const b02 = b[2]; + const b03 = b[3]; + const b10 = b[4 + 0]; + const b11 = b[4 + 1]; + const b12 = b[4 + 2]; + const b13 = b[4 + 3]; + const b20 = b[8 + 0]; + const b21 = b[8 + 1]; + const b22 = b[8 + 2]; + const b23 = b[8 + 3]; + const b30 = b[12 + 0]; + const b31 = b[12 + 1]; + const b32 = b[12 + 2]; + const b33 = b[12 + 3]; + newDst[0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03; + newDst[1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03; + newDst[2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03; + newDst[3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03; + newDst[4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13; + newDst[5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13; + newDst[6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13; + newDst[7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13; + newDst[8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23; + newDst[9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23; + newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23; + newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23; + newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33; + newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33; + newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33; + newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33; + return newDst; + } + /** + * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply) + * @param a - The matrix on the left. + * @param b - The matrix on the right. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The matrix product of a and b. + */ + const mul = multiply; + /** + * Sets the translation component of a 4-by-4 matrix to the given + * vector. + * @param a - The matrix. + * @param v - The vector. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The matrix with translation set. + */ + function setTranslation(a, v, dst) { + const newDst = (dst ?? identity()); + if (a !== newDst) { + newDst[0] = a[0]; + newDst[1] = a[1]; + newDst[2] = a[2]; + newDst[3] = a[3]; + newDst[4] = a[4]; + newDst[5] = a[5]; + newDst[6] = a[6]; + newDst[7] = a[7]; + newDst[8] = a[8]; + newDst[9] = a[9]; + newDst[10] = a[10]; + newDst[11] = a[11]; + } + newDst[12] = v[0]; + newDst[13] = v[1]; + newDst[14] = v[2]; + newDst[15] = 1; + return newDst; + } + ///** + // * Returns the translation component of a 4-by-4 matrix as a vector with 3 + // * entries. + // * @param m - The matrix. + // * @param dst - vector to hold result. If not passed a new one is created. + // * @returns The translation component of m. + // */ + function getTranslation(m, dst) { + const newDst = (dst ?? vec3.create()); + newDst[0] = m[12]; + newDst[1] = m[13]; + newDst[2] = m[14]; + return newDst; + } + /** + * Returns an axis of a 4x4 matrix as a vector with 3 entries + * @param m - The matrix. + * @param axis - The axis 0 = x, 1 = y, 2 = z; + * @returns The axis component of m. + */ + function getAxis(m, axis, dst) { + const newDst = (dst ?? vec3.create()); + const off = axis * 4; + newDst[0] = m[off + 0]; + newDst[1] = m[off + 1]; + newDst[2] = m[off + 2]; + return newDst; + } + /** + * Sets an axis of a 4x4 matrix as a vector with 3 entries + * @param m - The matrix. + * @param v - the axis vector + * @param axis - The axis 0 = x, 1 = y, 2 = z; + * @param dst - The matrix to set. If not passed a new one is created. + * @returns The matrix with axis set. + */ + function setAxis(m, v, axis, dst) { + const newDst = (dst === m) ? dst : copy(m, dst); + const off = axis * 4; + newDst[off + 0] = v[0]; + newDst[off + 1] = v[1]; + newDst[off + 2] = v[2]; + return newDst; + } + /** + * Returns the "3d" scaling component of the matrix + * @param m - The Matrix + * @param dst - The vector to set. If not passed a new one is created. + */ + function getScaling(m, dst) { + const newDst = (dst ?? vec3.create()); + const xx = m[0]; + const xy = m[1]; + const xz = m[2]; + const yx = m[4]; + const yy = m[5]; + const yz = m[6]; + const zx = m[8]; + const zy = m[9]; + const zz = m[10]; + newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz); + newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz); + newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz); + return newDst; + } + /** + * Computes a 4-by-4 perspective transformation matrix given the angular height + * of the frustum, the aspect ratio, and the near and far clipping planes. The + * arguments define a frustum extending in the negative z direction. The given + * angle is the vertical angle of the frustum, and the horizontal angle is + * determined to produce the given aspect ratio. The arguments near and far are + * the distances to the near and far clipping planes. Note that near and far + * are not z coordinates, but rather they are distances along the negative + * z-axis. The matrix generated sends the viewing frustum to the unit box. + * We assume a unit box extending from -1 to 1 in the x and y dimensions and + * from 0 to 1 in the z dimension. + * + * Note: If you pass `Infinity` for zFar then it will produce a projection matrix + * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z + * otherwise. + * + * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians). + * @param aspect - The aspect ratio width / height. + * @param zNear - The depth (negative z coordinate) + * of the near clipping plane. + * @param zFar - The depth (negative z coordinate) + * of the far clipping plane. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The perspective matrix. + */ + function perspective(fieldOfViewYInRadians, aspect, zNear, zFar, dst) { + const newDst = (dst ?? new Ctor(16)); + const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians); + newDst[0] = f / aspect; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = f; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[11] = -1; + newDst[12] = 0; + newDst[13] = 0; + newDst[15] = 0; + if (Number.isFinite(zFar)) { + const rangeInv = 1 / (zNear - zFar); + newDst[10] = zFar * rangeInv; + newDst[14] = zFar * zNear * rangeInv; + } + else { + newDst[10] = -1; + newDst[14] = -zNear; + } + return newDst; + } + /** + * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height + * of the frustum, the aspect ratio, and the near and far clipping planes. The + * arguments define a frustum extending in the negative z direction. The given + * angle is the vertical angle of the frustum, and the horizontal angle is + * determined to produce the given aspect ratio. The arguments near and far are + * the distances to the near and far clipping planes. Note that near and far + * are not z coordinates, but rather they are distances along the negative + * z-axis. The matrix generated sends the viewing frustum to the unit box. + * We assume a unit box extending from -1 to 1 in the x and y dimensions and + * from 1 (at -zNear) to 0 (at -zFar) in the z dimension. + * + * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians). + * @param aspect - The aspect ratio width / height. + * @param zNear - The depth (negative z coordinate) + * of the near clipping plane. + * @param zFar - The depth (negative z coordinate) + * of the far clipping plane. (default = Infinity) + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The perspective matrix. + */ function perspectiveReverseZ(fieldOfViewYInRadians, aspect, zNear, zFar = Infinity, dst) { + const newDst = (dst ?? new Ctor(16)); + const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5); + newDst[0] = f / aspect; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = f; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[11] = -1; + newDst[12] = 0; + newDst[13] = 0; + newDst[15] = 0; + if (zFar === Infinity) { + newDst[10] = 0; + newDst[14] = zNear; + } + else { + const rangeInv = 1 / (zFar - zNear); + newDst[10] = zNear * rangeInv; + newDst[14] = zFar * zNear * rangeInv; + } + return newDst; + } + /** + * Computes a 4-by-4 orthogonal transformation matrix that transforms from + * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y + * and 0 to +1 in z. + * @param left - Left side of the near clipping plane viewport. + * @param right - Right side of the near clipping plane viewport. + * @param bottom - Bottom of the near clipping plane viewport. + * @param top - Top of the near clipping plane viewport. + * @param near - The depth (negative z coordinate) + * of the near clipping plane. + * @param far - The depth (negative z coordinate) + * of the far clipping plane. + * @param dst - Output matrix. If not passed a new one is created. + * @returns The orthographic projection matrix. + */ + function ortho(left, right, bottom, top, near, far, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = 2 / (right - left); + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = 2 / (top - bottom); + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1 / (near - far); + newDst[11] = 0; + newDst[12] = (right + left) / (left - right); + newDst[13] = (top + bottom) / (bottom - top); + newDst[14] = near / (near - far); + newDst[15] = 1; + return newDst; + } + /** + * Computes a 4-by-4 perspective transformation matrix given the left, right, + * top, bottom, near and far clipping planes. The arguments define a frustum + * extending in the negative z direction. The arguments near and far are the + * distances to the near and far clipping planes. Note that near and far are not + * z coordinates, but rather they are distances along the negative z-axis. The + * matrix generated sends the viewing frustum to the unit box. We assume a unit + * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z + * dimension. + * @param left - The x coordinate of the left plane of the box. + * @param right - The x coordinate of the right plane of the box. + * @param bottom - The y coordinate of the bottom plane of the box. + * @param top - The y coordinate of the right plane of the box. + * @param near - The negative z coordinate of the near plane of the box. + * @param far - The negative z coordinate of the far plane of the box. + * @param dst - Output matrix. If not passed a new one is created. + * @returns The perspective projection matrix. + */ + function frustum(left, right, bottom, top, near, far, dst) { + const newDst = (dst ?? new Ctor(16)); + const dx = (right - left); + const dy = (top - bottom); + const dz = (near - far); + newDst[0] = 2 * near / dx; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = 2 * near / dy; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = (left + right) / dx; + newDst[9] = (top + bottom) / dy; + newDst[10] = far / dz; + newDst[11] = -1; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = near * far / dz; + newDst[15] = 0; + return newDst; + } + /** + * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right, + * top, bottom, near and far clipping planes. The arguments define a frustum + * extending in the negative z direction. The arguments near and far are the + * distances to the near and far clipping planes. Note that near and far are not + * z coordinates, but rather they are distances along the negative z-axis. The + * matrix generated sends the viewing frustum to the unit box. We assume a unit + * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z + * dimension. + * @param left - The x coordinate of the left plane of the box. + * @param right - The x coordinate of the right plane of the box. + * @param bottom - The y coordinate of the bottom plane of the box. + * @param top - The y coordinate of the right plane of the box. + * @param near - The negative z coordinate of the near plane of the box. + * @param far - The negative z coordinate of the far plane of the box. + * @param dst - Output matrix. If not passed a new one is created. + * @returns The perspective projection matrix. + */ + function frustumReverseZ(left, right, bottom, top, near, far = Infinity, dst) { + const newDst = (dst ?? new Ctor(16)); + const dx = (right - left); + const dy = (top - bottom); + newDst[0] = 2 * near / dx; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = 2 * near / dy; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = (left + right) / dx; + newDst[9] = (top + bottom) / dy; + newDst[11] = -1; + newDst[12] = 0; + newDst[13] = 0; + newDst[15] = 0; + if (far === Infinity) { + newDst[10] = 0; + newDst[14] = near; + } + else { + const rangeInv = 1 / (far - near); + newDst[10] = near * rangeInv; + newDst[14] = far * near * rangeInv; + } + return newDst; + } + const xAxis = vec3.create(); + const yAxis = vec3.create(); + const zAxis = vec3.create(); + /** + * Computes a 4-by-4 aim transformation. + * + * This is a matrix which positions an object aiming down positive Z. + * toward the target. + * + * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z. + * + * @param position - The position of the object. + * @param target - The position meant to be aimed at. + * @param up - A vector pointing up. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The aim matrix. + */ + function aim(position, target, up, dst) { + const newDst = (dst ?? new Ctor(16)); + vec3.normalize(vec3.subtract(target, position, zAxis), zAxis); + vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis); + vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis); + newDst[0] = xAxis[0]; + newDst[1] = xAxis[1]; + newDst[2] = xAxis[2]; + newDst[3] = 0; + newDst[4] = yAxis[0]; + newDst[5] = yAxis[1]; + newDst[6] = yAxis[2]; + newDst[7] = 0; + newDst[8] = zAxis[0]; + newDst[9] = zAxis[1]; + newDst[10] = zAxis[2]; + newDst[11] = 0; + newDst[12] = position[0]; + newDst[13] = position[1]; + newDst[14] = position[2]; + newDst[15] = 1; + return newDst; + } + /** + * Computes a 4-by-4 camera aim transformation. + * + * This is a matrix which positions an object aiming down negative Z. + * toward the target. + * + * Note: this is the inverse of `lookAt` + * + * @param eye - The position of the object. + * @param target - The position meant to be aimed at. + * @param up - A vector pointing up. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The aim matrix. + */ + function cameraAim(eye, target, up, dst) { + const newDst = (dst ?? new Ctor(16)); + vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis); + vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis); + vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis); + newDst[0] = xAxis[0]; + newDst[1] = xAxis[1]; + newDst[2] = xAxis[2]; + newDst[3] = 0; + newDst[4] = yAxis[0]; + newDst[5] = yAxis[1]; + newDst[6] = yAxis[2]; + newDst[7] = 0; + newDst[8] = zAxis[0]; + newDst[9] = zAxis[1]; + newDst[10] = zAxis[2]; + newDst[11] = 0; + newDst[12] = eye[0]; + newDst[13] = eye[1]; + newDst[14] = eye[2]; + newDst[15] = 1; + return newDst; + } + /** + * Computes a 4-by-4 view transformation. + * + * This is a view matrix which transforms all other objects + * to be in the space of the view defined by the parameters. + * + * @param eye - The position of the object. + * @param target - The position meant to be aimed at. + * @param up - A vector pointing up. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The look-at matrix. + */ + function lookAt(eye, target, up, dst) { + const newDst = (dst ?? new Ctor(16)); + vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis); + vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis); + vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis); + newDst[0] = xAxis[0]; + newDst[1] = yAxis[0]; + newDst[2] = zAxis[0]; + newDst[3] = 0; + newDst[4] = xAxis[1]; + newDst[5] = yAxis[1]; + newDst[6] = zAxis[1]; + newDst[7] = 0; + newDst[8] = xAxis[2]; + newDst[9] = yAxis[2]; + newDst[10] = zAxis[2]; + newDst[11] = 0; + newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]); + newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]); + newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]); + newDst[15] = 1; + return newDst; + } + /** + * Creates a 4-by-4 matrix which translates by the given vector v. + * @param v - The vector by + * which to translate. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The translation matrix. + */ + function translation(v, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + newDst[11] = 0; + newDst[12] = v[0]; + newDst[13] = v[1]; + newDst[14] = v[2]; + newDst[15] = 1; + return newDst; + } + /** + * Translates the given 4-by-4 matrix by the given vector v. + * @param m - The matrix. + * @param v - The vector by + * which to translate. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The translated matrix. + */ + function translate(m, v, dst) { + const newDst = (dst ?? new Ctor(16)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const m00 = m[0]; + const m01 = m[1]; + const m02 = m[2]; + const m03 = m[3]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m13 = m[1 * 4 + 3]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const m23 = m[2 * 4 + 3]; + const m30 = m[3 * 4 + 0]; + const m31 = m[3 * 4 + 1]; + const m32 = m[3 * 4 + 2]; + const m33 = m[3 * 4 + 3]; + if (m !== newDst) { + newDst[0] = m00; + newDst[1] = m01; + newDst[2] = m02; + newDst[3] = m03; + newDst[4] = m10; + newDst[5] = m11; + newDst[6] = m12; + newDst[7] = m13; + newDst[8] = m20; + newDst[9] = m21; + newDst[10] = m22; + newDst[11] = m23; + } + newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30; + newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31; + newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32; + newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33; + return newDst; + } + /** + * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationX(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = c; + newDst[6] = s; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = -s; + newDst[10] = c; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Rotates the given 4-by-4 matrix around the x-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateX(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + const m10 = m[4]; + const m11 = m[5]; + const m12 = m[6]; + const m13 = m[7]; + const m20 = m[8]; + const m21 = m[9]; + const m22 = m[10]; + const m23 = m[11]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[4] = c * m10 + s * m20; + newDst[5] = c * m11 + s * m21; + newDst[6] = c * m12 + s * m22; + newDst[7] = c * m13 + s * m23; + newDst[8] = c * m20 - s * m10; + newDst[9] = c * m21 - s * m11; + newDst[10] = c * m22 - s * m12; + newDst[11] = c * m23 - s * m13; + if (m !== newDst) { + newDst[0] = m[0]; + newDst[1] = m[1]; + newDst[2] = m[2]; + newDst[3] = m[3]; + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + } + return newDst; + } + /** + * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationY(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c; + newDst[1] = 0; + newDst[2] = -s; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = 1; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = s; + newDst[9] = 0; + newDst[10] = c; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Rotates the given 4-by-4 matrix around the y-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateY(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m03 = m[0 * 4 + 3]; + const m20 = m[2 * 4 + 0]; + const m21 = m[2 * 4 + 1]; + const m22 = m[2 * 4 + 2]; + const m23 = m[2 * 4 + 3]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c * m00 - s * m20; + newDst[1] = c * m01 - s * m21; + newDst[2] = c * m02 - s * m22; + newDst[3] = c * m03 - s * m23; + newDst[8] = c * m20 + s * m00; + newDst[9] = c * m21 + s * m01; + newDst[10] = c * m22 + s * m02; + newDst[11] = c * m23 + s * m03; + if (m !== newDst) { + newDst[4] = m[4]; + newDst[5] = m[5]; + newDst[6] = m[6]; + newDst[7] = m[7]; + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + } + return newDst; + } + /** + * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotation matrix. + */ + function rotationZ(angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c; + newDst[1] = s; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = -s; + newDst[5] = c; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = 1; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Rotates the given 4-by-4 matrix around the z-axis by the given + * angle. + * @param m - The matrix. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function rotateZ(m, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + const m00 = m[0 * 4 + 0]; + const m01 = m[0 * 4 + 1]; + const m02 = m[0 * 4 + 2]; + const m03 = m[0 * 4 + 3]; + const m10 = m[1 * 4 + 0]; + const m11 = m[1 * 4 + 1]; + const m12 = m[1 * 4 + 2]; + const m13 = m[1 * 4 + 3]; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + newDst[0] = c * m00 + s * m10; + newDst[1] = c * m01 + s * m11; + newDst[2] = c * m02 + s * m12; + newDst[3] = c * m03 + s * m13; + newDst[4] = c * m10 - s * m00; + newDst[5] = c * m11 - s * m01; + newDst[6] = c * m12 - s * m02; + newDst[7] = c * m13 - s * m03; + if (m !== newDst) { + newDst[8] = m[8]; + newDst[9] = m[9]; + newDst[10] = m[10]; + newDst[11] = m[11]; + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + } + return newDst; + } + /** + * Creates a 4-by-4 matrix which rotates around the given axis by the given + * angle. + * @param axis - The axis + * about which to rotate. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns A matrix which rotates angle radians + * around the axis. + */ + function axisRotation(axis, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + const n = Math.sqrt(x * x + y * y + z * z); + x /= n; + y /= n; + z /= n; + const xx = x * x; + const yy = y * y; + const zz = z * z; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + const oneMinusCosine = 1 - c; + newDst[0] = xx + (1 - xx) * c; + newDst[1] = x * y * oneMinusCosine + z * s; + newDst[2] = x * z * oneMinusCosine - y * s; + newDst[3] = 0; + newDst[4] = x * y * oneMinusCosine - z * s; + newDst[5] = yy + (1 - yy) * c; + newDst[6] = y * z * oneMinusCosine + x * s; + newDst[7] = 0; + newDst[8] = x * z * oneMinusCosine + y * s; + newDst[9] = y * z * oneMinusCosine - x * s; + newDst[10] = zz + (1 - zz) * c; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Creates a 4-by-4 matrix which rotates around the given axis by the given + * angle. (same as axisRotation) + * @param axis - The axis + * about which to rotate. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns A matrix which rotates angle radians + * around the axis. + */ + const rotation = axisRotation; + /** + * Rotates the given 4-by-4 matrix around the given axis by the + * given angle. + * @param m - The matrix. + * @param axis - The axis + * about which to rotate. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + function axisRotate(m, axis, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(16)); + let x = axis[0]; + let y = axis[1]; + let z = axis[2]; + const n = Math.sqrt(x * x + y * y + z * z); + x /= n; + y /= n; + z /= n; + const xx = x * x; + const yy = y * y; + const zz = z * z; + const c = Math.cos(angleInRadians); + const s = Math.sin(angleInRadians); + const oneMinusCosine = 1 - c; + const r00 = xx + (1 - xx) * c; + const r01 = x * y * oneMinusCosine + z * s; + const r02 = x * z * oneMinusCosine - y * s; + const r10 = x * y * oneMinusCosine - z * s; + const r11 = yy + (1 - yy) * c; + const r12 = y * z * oneMinusCosine + x * s; + const r20 = x * z * oneMinusCosine + y * s; + const r21 = y * z * oneMinusCosine - x * s; + const r22 = zz + (1 - zz) * c; + const m00 = m[0]; + const m01 = m[1]; + const m02 = m[2]; + const m03 = m[3]; + const m10 = m[4]; + const m11 = m[5]; + const m12 = m[6]; + const m13 = m[7]; + const m20 = m[8]; + const m21 = m[9]; + const m22 = m[10]; + const m23 = m[11]; + newDst[0] = r00 * m00 + r01 * m10 + r02 * m20; + newDst[1] = r00 * m01 + r01 * m11 + r02 * m21; + newDst[2] = r00 * m02 + r01 * m12 + r02 * m22; + newDst[3] = r00 * m03 + r01 * m13 + r02 * m23; + newDst[4] = r10 * m00 + r11 * m10 + r12 * m20; + newDst[5] = r10 * m01 + r11 * m11 + r12 * m21; + newDst[6] = r10 * m02 + r11 * m12 + r12 * m22; + newDst[7] = r10 * m03 + r11 * m13 + r12 * m23; + newDst[8] = r20 * m00 + r21 * m10 + r22 * m20; + newDst[9] = r20 * m01 + r21 * m11 + r22 * m21; + newDst[10] = r20 * m02 + r21 * m12 + r22 * m22; + newDst[11] = r20 * m03 + r21 * m13 + r22 * m23; + if (m !== newDst) { + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + } + return newDst; + } + /** + * Rotates the given 4-by-4 matrix around the given axis by the + * given angle. (same as rotate) + * @param m - The matrix. + * @param axis - The axis + * about which to rotate. + * @param angleInRadians - The angle by which to rotate (in radians). + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The rotated matrix. + */ + const rotate = axisRotate; + /** + * Creates a 4-by-4 matrix which scales in each dimension by an amount given by + * the corresponding entry in the given vector; assumes the vector has three + * entries. + * @param v - A vector of + * three entries specifying the factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function scaling(v, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = v[0]; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = v[1]; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = v[2]; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Scales the given 4-by-4 matrix in each dimension by an amount + * given by the corresponding entry in the given vector; assumes the vector has + * three entries. + * @param m - The matrix to be modified. + * @param v - A vector of three entries specifying the + * factor by which to scale in each dimension. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function scale(m, v, dst) { + const newDst = (dst ?? new Ctor(16)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + newDst[0] = v0 * m[0 * 4 + 0]; + newDst[1] = v0 * m[0 * 4 + 1]; + newDst[2] = v0 * m[0 * 4 + 2]; + newDst[3] = v0 * m[0 * 4 + 3]; + newDst[4] = v1 * m[1 * 4 + 0]; + newDst[5] = v1 * m[1 * 4 + 1]; + newDst[6] = v1 * m[1 * 4 + 2]; + newDst[7] = v1 * m[1 * 4 + 3]; + newDst[8] = v2 * m[2 * 4 + 0]; + newDst[9] = v2 * m[2 * 4 + 1]; + newDst[10] = v2 * m[2 * 4 + 2]; + newDst[11] = v2 * m[2 * 4 + 3]; + if (m !== newDst) { + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + } + return newDst; + } + /** + * Creates a 4-by-4 matrix which scales a uniform amount in each dimension. + * @param s - the amount to scale + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaling matrix. + */ + function uniformScaling(s, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = s; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + newDst[4] = 0; + newDst[5] = s; + newDst[6] = 0; + newDst[7] = 0; + newDst[8] = 0; + newDst[9] = 0; + newDst[10] = s; + newDst[11] = 0; + newDst[12] = 0; + newDst[13] = 0; + newDst[14] = 0; + newDst[15] = 1; + return newDst; + } + /** + * Scales the given 4-by-4 matrix in each dimension by a uniform scale. + * @param m - The matrix to be modified. + * @param s - The amount to scale. + * @param dst - matrix to hold result. If not passed a new one is created. + * @returns The scaled matrix. + */ + function uniformScale(m, s, dst) { + const newDst = (dst ?? new Ctor(16)); + newDst[0] = s * m[0 * 4 + 0]; + newDst[1] = s * m[0 * 4 + 1]; + newDst[2] = s * m[0 * 4 + 2]; + newDst[3] = s * m[0 * 4 + 3]; + newDst[4] = s * m[1 * 4 + 0]; + newDst[5] = s * m[1 * 4 + 1]; + newDst[6] = s * m[1 * 4 + 2]; + newDst[7] = s * m[1 * 4 + 3]; + newDst[8] = s * m[2 * 4 + 0]; + newDst[9] = s * m[2 * 4 + 1]; + newDst[10] = s * m[2 * 4 + 2]; + newDst[11] = s * m[2 * 4 + 3]; + if (m !== newDst) { + newDst[12] = m[12]; + newDst[13] = m[13]; + newDst[14] = m[14]; + newDst[15] = m[15]; + } + return newDst; + } + return { + create, + set, + fromMat3, + fromQuat, + negate, + copy, + clone, + equalsApproximately, + equals, + identity, + transpose, + inverse, + determinant, + invert, + multiply, + mul, + setTranslation, + getTranslation, + getAxis, + setAxis, + getScaling, + perspective, + perspectiveReverseZ, + ortho, + frustum, + frustumReverseZ, + aim, + cameraAim, + lookAt, + translation, + translate, + rotationX, + rotateX, + rotationY, + rotateY, + rotationZ, + rotateZ, + axisRotation, + rotation, + axisRotate, + rotate, + scaling, + scale, + uniformScaling, + uniformScale, + }; +} +const cache$2 = new Map(); +function getAPI$2(Ctor) { + let api = cache$2.get(Ctor); + if (!api) { + api = getAPIImpl$2(Ctor); + cache$2.set(Ctor, api); + } + return api; +} + +/* + * Copyright 2022 Gregg Tavares + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/** + * Generates am typed API for Qud + * */ +function getAPIImpl$1(Ctor) { + const vec3 = getAPI$4(Ctor); + /** + * Creates a quat4; may be called with x, y, z to set initial values. + * @param x - Initial x value. + * @param y - Initial y value. + * @param z - Initial z value. + * @param w - Initial w value. + * @returns the created vector + */ + function create(x, y, z, w) { + const newDst = new Ctor(4); + if (x !== undefined) { + newDst[0] = x; + if (y !== undefined) { + newDst[1] = y; + if (z !== undefined) { + newDst[2] = z; + if (w !== undefined) { + newDst[3] = w; + } + } + } + } + return newDst; + } + /** + * Creates a Quat; may be called with x, y, z to set initial values. (same as create) + * @param x - Initial x value. + * @param y - Initial y value. + * @param z - Initial z value. + * @param z - Initial w value. + * @returns the created vector + */ + const fromValues = create; + /** + * Sets the values of a Quat + * Also see {@link quat.create} and {@link quat.copy} + * + * @param x first value + * @param y second value + * @param z third value + * @param w fourth value + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector with its elements set. + */ + function set(x, y, z, w, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = x; + newDst[1] = y; + newDst[2] = z; + newDst[3] = w; + return newDst; + } + /** + * Sets a quaternion from the given angle and axis, + * then returns it. + * + * @param axis - the axis to rotate around + * @param angleInRadians - the angle + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The quaternion that represents the given axis and angle + **/ + function fromAxisAngle(axis, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(4)); + const halfAngle = angleInRadians * 0.5; + const s = Math.sin(halfAngle); + newDst[0] = s * axis[0]; + newDst[1] = s * axis[1]; + newDst[2] = s * axis[2]; + newDst[3] = Math.cos(halfAngle); + return newDst; + } + /** + * Gets the rotation axis and angle + * @param q - quaternion to compute from + * @param dst - Vec3 to hold result. If not passed in a new one is created. + * @return angle and axis + */ + function toAxisAngle(q, dst) { + const newDst = (dst ?? vec3.create(3)); + const angle = Math.acos(q[3]) * 2; + const s = Math.sin(angle * 0.5); + if (s > EPSILON) { + newDst[0] = q[0] / s; + newDst[1] = q[1] / s; + newDst[2] = q[2] / s; + } + else { + newDst[0] = 1; + newDst[1] = 0; + newDst[2] = 0; + } + return { angle, axis: newDst }; + } + /** + * Returns the angle in degrees between two rotations a and b. + * @param a - quaternion a + * @param b - quaternion b + * @return angle in radians between the two quaternions + */ + function angle(a, b) { + const d = dot(a, b); + return Math.acos(2 * d * d - 1); + } + /** + * Multiplies two quaternions + * + * @param a - the first quaternion + * @param b - the second quaternion + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the result of a * b + */ + function multiply(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + const bx = b[0]; + const by = b[1]; + const bz = b[2]; + const bw = b[3]; + newDst[0] = ax * bw + aw * bx + ay * bz - az * by; + newDst[1] = ay * bw + aw * by + az * bx - ax * bz; + newDst[2] = az * bw + aw * bz + ax * by - ay * bx; + newDst[3] = aw * bw - ax * bx - ay * by - az * bz; + return newDst; + } + /** + * Multiplies two quaternions + * + * @param a - the first quaternion + * @param b - the second quaternion + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the result of a * b + */ + const mul = multiply; + /** + * Rotates the given quaternion around the X axis by the given angle. + * @param q - quaternion to rotate + * @param angleInRadians - The angle by which to rotate + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the result of a * b + */ + function rotateX(q, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(4)); + const halfAngle = angleInRadians * 0.5; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const bx = Math.sin(halfAngle); + const bw = Math.cos(halfAngle); + newDst[0] = qx * bw + qw * bx; + newDst[1] = qy * bw + qz * bx; + newDst[2] = qz * bw - qy * bx; + newDst[3] = qw * bw - qx * bx; + return newDst; + } + /** + * Rotates the given quaternion around the Y axis by the given angle. + * @param q - quaternion to rotate + * @param angleInRadians - The angle by which to rotate + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the result of a * b + */ + function rotateY(q, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(4)); + const halfAngle = angleInRadians * 0.5; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const by = Math.sin(halfAngle); + const bw = Math.cos(halfAngle); + newDst[0] = qx * bw - qz * by; + newDst[1] = qy * bw + qw * by; + newDst[2] = qz * bw + qx * by; + newDst[3] = qw * bw - qy * by; + return newDst; + } + /** + * Rotates the given quaternion around the Z axis by the given angle. + * @param q - quaternion to rotate + * @param angleInRadians - The angle by which to rotate + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the result of a * b + */ + function rotateZ(q, angleInRadians, dst) { + const newDst = (dst ?? new Ctor(4)); + const halfAngle = angleInRadians * 0.5; + const qx = q[0]; + const qy = q[1]; + const qz = q[2]; + const qw = q[3]; + const bz = Math.sin(halfAngle); + const bw = Math.cos(halfAngle); + newDst[0] = qx * bw + qy * bz; + newDst[1] = qy * bw - qx * bz; + newDst[2] = qz * bw + qw * bz; + newDst[3] = qw * bw - qz * bz; + return newDst; + } + /** + * Spherically linear interpolate between two quaternions + * + * @param a - starting value + * @param b - ending value + * @param t - value where 0 = a and 1 = b + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the result of a * b + */ + function slerp(a, b, t, dst) { + const newDst = (dst ?? new Ctor(4)); + const ax = a[0]; + const ay = a[1]; + const az = a[2]; + const aw = a[3]; + let bx = b[0]; + let by = b[1]; + let bz = b[2]; + let bw = b[3]; + let cosOmega = ax * bx + ay * by + az * bz + aw * bw; + if (cosOmega < 0) { + cosOmega = -cosOmega; + bx = -bx; + by = -by; + bz = -bz; + bw = -bw; + } + let scale0; + let scale1; + if (1.0 - cosOmega > EPSILON) { + const omega = Math.acos(cosOmega); + const sinOmega = Math.sin(omega); + scale0 = Math.sin((1 - t) * omega) / sinOmega; + scale1 = Math.sin(t * omega) / sinOmega; + } + else { + scale0 = 1.0 - t; + scale1 = t; + } + newDst[0] = scale0 * ax + scale1 * bx; + newDst[1] = scale0 * ay + scale1 * by; + newDst[2] = scale0 * az + scale1 * bz; + newDst[3] = scale0 * aw + scale1 * bw; + return newDst; + } + /** + * Compute the inverse of a quaternion + * + * @param q - quaternion to compute the inverse of + * @returns A quaternion that is the result of a * b + */ + function inverse(q, dst) { + const newDst = (dst ?? new Ctor(4)); + const a0 = q[0]; + const a1 = q[1]; + const a2 = q[2]; + const a3 = q[3]; + const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + const invDot = dot ? 1 / dot : 0; + newDst[0] = -a0 * invDot; + newDst[1] = -a1 * invDot; + newDst[2] = -a2 * invDot; + newDst[3] = a3 * invDot; + return newDst; + } + /** + * Compute the conjugate of a quaternion + * For quaternions with a magnitude of 1 (a unit quaternion) + * this returns the same as the inverse but is faster to calculate. + * + * @param q - quaternion to compute the conjugate of. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The conjugate of q + */ + function conjugate(q, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = -q[0]; + newDst[1] = -q[1]; + newDst[2] = -q[2]; + newDst[3] = q[3]; + return newDst; + } + /** + * Creates a quaternion from the given rotation matrix. + * + * The created quaternion is not normalized. + * + * @param m - rotation matrix + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns the result + */ + function fromMat(m, dst) { + const newDst = (dst ?? new Ctor(4)); + /* + 0 1 2 + 3 4 5 + 6 7 8 + + 0 1 2 + 4 5 6 + 8 9 10 + */ + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + const trace = m[0] + m[5] + m[10]; + if (trace > 0.0) { + // |w| > 1/2, may as well choose w > 1/2 + const root = Math.sqrt(trace + 1); // 2w + newDst[3] = 0.5 * root; + const invRoot = 0.5 / root; // 1/(4w) + newDst[0] = (m[6] - m[9]) * invRoot; + newDst[1] = (m[8] - m[2]) * invRoot; + newDst[2] = (m[1] - m[4]) * invRoot; + } + else { + // |w| <= 1/2 + let i = 0; + if (m[5] > m[0]) { + i = 1; + } + if (m[10] > m[i * 4 + i]) { + i = 2; + } + const j = (i + 1) % 3; + const k = (i + 2) % 3; + const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0); + newDst[i] = 0.5 * root; + const invRoot = 0.5 / root; + newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot; + newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot; + newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot; + } + return newDst; + } + /** + * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion. + * + * @param xAngleInRadians - angle to rotate around X axis in radians. + * @param yAngleInRadians - angle to rotate around Y axis in radians. + * @param zAngleInRadians - angle to rotate around Z axis in radians. + * @param order - order to apply euler angles + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion representing the same rotation as the euler angles applied in the given order + */ + function fromEuler(xAngleInRadians, yAngleInRadians, zAngleInRadians, order, dst) { + const newDst = (dst ?? new Ctor(4)); + const xHalfAngle = xAngleInRadians * 0.5; + const yHalfAngle = yAngleInRadians * 0.5; + const zHalfAngle = zAngleInRadians * 0.5; + const sx = Math.sin(xHalfAngle); + const cx = Math.cos(xHalfAngle); + const sy = Math.sin(yHalfAngle); + const cy = Math.cos(yHalfAngle); + const sz = Math.sin(zHalfAngle); + const cz = Math.cos(zHalfAngle); + switch (order) { + case 'xyz': + newDst[0] = sx * cy * cz + cx * sy * sz; + newDst[1] = cx * sy * cz - sx * cy * sz; + newDst[2] = cx * cy * sz + sx * sy * cz; + newDst[3] = cx * cy * cz - sx * sy * sz; + break; + case 'xzy': + newDst[0] = sx * cy * cz - cx * sy * sz; + newDst[1] = cx * sy * cz - sx * cy * sz; + newDst[2] = cx * cy * sz + sx * sy * cz; + newDst[3] = cx * cy * cz + sx * sy * sz; + break; + case 'yxz': + newDst[0] = sx * cy * cz + cx * sy * sz; + newDst[1] = cx * sy * cz - sx * cy * sz; + newDst[2] = cx * cy * sz - sx * sy * cz; + newDst[3] = cx * cy * cz + sx * sy * sz; + break; + case 'yzx': + newDst[0] = sx * cy * cz + cx * sy * sz; + newDst[1] = cx * sy * cz + sx * cy * sz; + newDst[2] = cx * cy * sz - sx * sy * cz; + newDst[3] = cx * cy * cz - sx * sy * sz; + break; + case 'zxy': + newDst[0] = sx * cy * cz - cx * sy * sz; + newDst[1] = cx * sy * cz + sx * cy * sz; + newDst[2] = cx * cy * sz + sx * sy * cz; + newDst[3] = cx * cy * cz - sx * sy * sz; + break; + case 'zyx': + newDst[0] = sx * cy * cz - cx * sy * sz; + newDst[1] = cx * sy * cz + sx * cy * sz; + newDst[2] = cx * cy * sz - sx * sy * cz; + newDst[3] = cx * cy * cz + sx * sy * sz; + break; + default: + throw new Error(`Unknown rotation order: ${order}`); + } + return newDst; + } + /** + * Copies a quaternion. (same as {@link quat.clone}) + * Also see {@link quat.create} and {@link quat.set} + * @param q - The quaternion. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is a copy of q + */ + function copy(q, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = q[0]; + newDst[1] = q[1]; + newDst[2] = q[2]; + newDst[3] = q[3]; + return newDst; + } + /** + * Clones a quaternion. (same as {@link quat.copy}) + * Also see {@link quat.create} and {@link quat.set} + * @param q - The quaternion. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A copy of q. + */ + const clone = copy; + /** + * Adds two quaternions; assumes a and b have the same dimension. + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the sum of a and b. + */ + function add(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] + b[0]; + newDst[1] = a[1] + b[1]; + newDst[2] = a[2] + b[2]; + newDst[3] = a[3] + b[3]; + return newDst; + } + /** + * Subtracts two quaternions. + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the difference of a and b. + */ + function subtract(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] - b[0]; + newDst[1] = a[1] - b[1]; + newDst[2] = a[2] - b[2]; + newDst[3] = a[3] - b[3]; + return newDst; + } + /** + * Subtracts two quaternions. + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns A quaternion that is the difference of a and b. + */ + const sub = subtract; + /** + * Multiplies a quaternion by a scalar. + * @param v - The quaternion. + * @param k - The scalar. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The scaled quaternion. + */ + function mulScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = v[0] * k; + newDst[1] = v[1] * k; + newDst[2] = v[2] * k; + newDst[3] = v[3] * k; + return newDst; + } + /** + * Multiplies a quaternion by a scalar. (same as mulScalar) + * @param v - The quaternion. + * @param k - The scalar. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The scaled quaternion. + */ + const scale = mulScalar; + /** + * Divides a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The scaled quaternion. + */ + function divScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = v[0] / k; + newDst[1] = v[1] / k; + newDst[2] = v[2] / k; + newDst[3] = v[3] / k; + return newDst; + } + /** + * Computes the dot product of two quaternions + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @returns dot product + */ + function dot(a, b) { + return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]); + } + /** + * Performs linear interpolation on two quaternions. + * Given quaternions a and b and interpolation coefficient t, returns + * a + t * (b - a). + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @param t - Interpolation coefficient. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The linear interpolated result. + */ + function lerp(a, b, t, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] + t * (b[0] - a[0]); + newDst[1] = a[1] + t * (b[1] - a[1]); + newDst[2] = a[2] + t * (b[2] - a[2]); + newDst[3] = a[3] + t * (b[3] - a[3]); + return newDst; + } + /** + * Computes the length of quaternion + * @param v - quaternion. + * @returns length of quaternion. + */ + function length(v) { + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const v3 = v[3]; + return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3); + } + /** + * Computes the length of quaternion (same as length) + * @param v - quaternion. + * @returns length of quaternion. + */ + const len = length; + /** + * Computes the square of the length of quaternion + * @param v - quaternion. + * @returns square of the length of quaternion. + */ + function lengthSq(v) { + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const v3 = v[3]; + return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3; + } + /** + * Computes the square of the length of quaternion (same as lengthSq) + * @param v - quaternion. + * @returns square of the length of quaternion. + */ + const lenSq = lengthSq; + /** + * Divides a quaternion by its Euclidean length and returns the quotient. + * @param v - The quaternion. + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns The normalized quaternion. + */ + function normalize(v, dst) { + const newDst = (dst ?? new Ctor(4)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const v3 = v[3]; + const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3); + if (len > 0.00001) { + newDst[0] = v0 / len; + newDst[1] = v1 / len; + newDst[2] = v2 / len; + newDst[3] = v3 / len; + } + else { + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 1; + } + return newDst; + } + /** + * Check if 2 quaternions are approximately equal + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @returns true if quaternions are approximately equal + */ + function equalsApproximately(a, b) { + return Math.abs(a[0] - b[0]) < EPSILON && + Math.abs(a[1] - b[1]) < EPSILON && + Math.abs(a[2] - b[2]) < EPSILON && + Math.abs(a[3] - b[3]) < EPSILON; + } + /** + * Check if 2 quaternions are exactly equal + * @param a - Operand quaternion. + * @param b - Operand quaternion. + * @returns true if quaternions are exactly equal + */ + function equals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Creates an identity quaternion + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns an identity quaternion + */ + function identity(dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 1; + return newDst; + } + const tempVec3 = vec3.create(); + const xUnitVec3 = vec3.create(); + const yUnitVec3 = vec3.create(); + /** + * Computes a quaternion to represent the shortest rotation from one vector to another. + * + * @param aUnit - the start vector + * @param bUnit - the end vector + * @param dst - quaternion to hold result. If not passed in a new one is created. + * @returns the result + */ + function rotationTo(aUnit, bUnit, dst) { + const newDst = (dst ?? new Ctor(4)); + const dot = vec3.dot(aUnit, bUnit); + if (dot < -0.999999) { + vec3.cross(xUnitVec3, aUnit, tempVec3); + if (vec3.len(tempVec3) < 0.000001) { + vec3.cross(yUnitVec3, aUnit, tempVec3); + } + vec3.normalize(tempVec3, tempVec3); + fromAxisAngle(tempVec3, Math.PI, newDst); + return newDst; + } + else if (dot > 0.999999) { + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 1; + return newDst; + } + else { + vec3.cross(aUnit, bUnit, tempVec3); + newDst[0] = tempVec3[0]; + newDst[1] = tempVec3[1]; + newDst[2] = tempVec3[2]; + newDst[3] = 1 + dot; + return normalize(newDst, newDst); + } + } + const tempQuat1 = new Ctor(4); + const tempQuat2 = new Ctor(4); + /** + * Performs a spherical linear interpolation with two control points + * + * @param a - the first quaternion + * @param b - the second quaternion + * @param c - the third quaternion + * @param d - the fourth quaternion + * @param t - Interpolation coefficient 0 to 1 + * @returns result + */ + function sqlerp(a, b, c, d, t, dst) { + const newDst = (dst ?? new Ctor(4)); + slerp(a, d, t, tempQuat1); + slerp(b, c, t, tempQuat2); + slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst); + return newDst; + } + return { + create, + fromValues, + set, + fromAxisAngle, + toAxisAngle, + angle, + multiply, + mul, + rotateX, + rotateY, + rotateZ, + slerp, + inverse, + conjugate, + fromMat, + fromEuler, + copy, + clone, + add, + subtract, + sub, + mulScalar, + scale, + divScalar, + dot, + lerp, + length, + len, + lengthSq, + lenSq, + normalize, + equalsApproximately, + equals, + identity, + rotationTo, + sqlerp, + }; +} +const cache$1 = new Map(); +/** + * + * Quat4 math functions. + * + * Almost all functions take an optional `newDst` argument. If it is not passed in the + * functions will create a new `Quat4`. In other words you can do this + * + * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2. + * + * or + * + * const v = quat4.create(); + * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v + * + * The first style is often easier but depending on where it's used it generates garbage where + * as there is almost never allocation with the second style. + * + * It is always safe to pass any vector as the destination. So for example + * + * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1 + * + */ +function getAPI$1(Ctor) { + let api = cache$1.get(Ctor); + if (!api) { + api = getAPIImpl$1(Ctor); + cache$1.set(Ctor, api); + } + return api; +} + +/* + * Copyright 2022 Gregg Tavares + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/** + * Generates am typed API for Vec4 + * */ +function getAPIImpl(Ctor) { + /** + * Creates a vec4; may be called with x, y, z to set initial values. + * @param x - Initial x value. + * @param y - Initial y value. + * @param z - Initial z value. + * @param w - Initial w value. + * @returns the created vector + */ + function create(x, y, z, w) { + const newDst = new Ctor(4); + if (x !== undefined) { + newDst[0] = x; + if (y !== undefined) { + newDst[1] = y; + if (z !== undefined) { + newDst[2] = z; + if (w !== undefined) { + newDst[3] = w; + } + } + } + } + return newDst; + } + /** + * Creates a vec4; may be called with x, y, z to set initial values. (same as create) + * @param x - Initial x value. + * @param y - Initial y value. + * @param z - Initial z value. + * @param z - Initial w value. + * @returns the created vector + */ + const fromValues = create; + /** + * Sets the values of a Vec4 + * Also see {@link vec4.create} and {@link vec4.copy} + * + * @param x first value + * @param y second value + * @param z third value + * @param w fourth value + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector with its elements set. + */ + function set(x, y, z, w, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = x; + newDst[1] = y; + newDst[2] = z; + newDst[3] = w; + return newDst; + } + /** + * Applies Math.ceil to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the ceil of each element of v. + */ + function ceil(v, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = Math.ceil(v[0]); + newDst[1] = Math.ceil(v[1]); + newDst[2] = Math.ceil(v[2]); + newDst[3] = Math.ceil(v[3]); + return newDst; + } + /** + * Applies Math.floor to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the floor of each element of v. + */ + function floor(v, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = Math.floor(v[0]); + newDst[1] = Math.floor(v[1]); + newDst[2] = Math.floor(v[2]); + newDst[3] = Math.floor(v[3]); + return newDst; + } + /** + * Applies Math.round to each element of vector + * @param v - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the round of each element of v. + */ + function round(v, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = Math.round(v[0]); + newDst[1] = Math.round(v[1]); + newDst[2] = Math.round(v[2]); + newDst[3] = Math.round(v[3]); + return newDst; + } + /** + * Clamp each element of vector between min and max + * @param v - Operand vector. + * @param max - Min value, default 0 + * @param min - Max value, default 1 + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that the clamped value of each element of v. + */ + function clamp(v, min = 0, max = 1, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = Math.min(max, Math.max(min, v[0])); + newDst[1] = Math.min(max, Math.max(min, v[1])); + newDst[2] = Math.min(max, Math.max(min, v[2])); + newDst[3] = Math.min(max, Math.max(min, v[3])); + return newDst; + } + /** + * Adds two vectors; assumes a and b have the same dimension. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the sum of a and b. + */ + function add(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] + b[0]; + newDst[1] = a[1] + b[1]; + newDst[2] = a[2] + b[2]; + newDst[3] = a[3] + b[3]; + return newDst; + } + /** + * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension. + * @param a - Operand vector. + * @param b - Operand vector. + * @param scale - Amount to scale b + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the sum of a + b * scale. + */ + function addScaled(a, b, scale, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] + b[0] * scale; + newDst[1] = a[1] + b[1] * scale; + newDst[2] = a[2] + b[2] * scale; + newDst[3] = a[3] + b[3] * scale; + return newDst; + } + /** + * Subtracts two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the difference of a and b. + */ + function subtract(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] - b[0]; + newDst[1] = a[1] - b[1]; + newDst[2] = a[2] - b[2]; + newDst[3] = a[3] - b[3]; + return newDst; + } + /** + * Subtracts two vectors. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A vector that is the difference of a and b. + */ + const sub = subtract; + /** + * Check if 2 vectors are approximately equal + * @param a - Operand vector. + * @param b - Operand vector. + * @returns true if vectors are approximately equal + */ + function equalsApproximately(a, b) { + return Math.abs(a[0] - b[0]) < EPSILON && + Math.abs(a[1] - b[1]) < EPSILON && + Math.abs(a[2] - b[2]) < EPSILON && + Math.abs(a[3] - b[3]) < EPSILON; + } + /** + * Check if 2 vectors are exactly equal + * @param a - Operand vector. + * @param b - Operand vector. + * @returns true if vectors are exactly equal + */ + function equals(a, b) { + return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; + } + /** + * Performs linear interpolation on two vectors. + * Given vectors a and b and interpolation coefficient t, returns + * a + t * (b - a). + * @param a - Operand vector. + * @param b - Operand vector. + * @param t - Interpolation coefficient. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The linear interpolated result. + */ + function lerp(a, b, t, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] + t * (b[0] - a[0]); + newDst[1] = a[1] + t * (b[1] - a[1]); + newDst[2] = a[2] + t * (b[2] - a[2]); + newDst[3] = a[3] + t * (b[3] - a[3]); + return newDst; + } + /** + * Performs linear interpolation on two vectors. + * Given vectors a and b and interpolation coefficient vector t, returns + * a + t * (b - a). + * @param a - Operand vector. + * @param b - Operand vector. + * @param t - Interpolation coefficients vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns the linear interpolated result. + */ + function lerpV(a, b, t, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] + t[0] * (b[0] - a[0]); + newDst[1] = a[1] + t[1] * (b[1] - a[1]); + newDst[2] = a[2] + t[2] * (b[2] - a[2]); + newDst[3] = a[3] + t[3] * (b[3] - a[3]); + return newDst; + } + /** + * Return max values of two vectors. + * Given vectors a and b returns + * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])]. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The max components vector. + */ + function max(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = Math.max(a[0], b[0]); + newDst[1] = Math.max(a[1], b[1]); + newDst[2] = Math.max(a[2], b[2]); + newDst[3] = Math.max(a[3], b[3]); + return newDst; + } + /** + * Return min values of two vectors. + * Given vectors a and b returns + * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])]. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The min components vector. + */ + function min(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = Math.min(a[0], b[0]); + newDst[1] = Math.min(a[1], b[1]); + newDst[2] = Math.min(a[2], b[2]); + newDst[3] = Math.min(a[3], b[3]); + return newDst; + } + /** + * Multiplies a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + function mulScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = v[0] * k; + newDst[1] = v[1] * k; + newDst[2] = v[2] * k; + newDst[3] = v[3] * k; + return newDst; + } + /** + * Multiplies a vector by a scalar. (same as mulScalar) + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + const scale = mulScalar; + /** + * Divides a vector by a scalar. + * @param v - The vector. + * @param k - The scalar. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The scaled vector. + */ + function divScalar(v, k, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = v[0] / k; + newDst[1] = v[1] / k; + newDst[2] = v[2] / k; + newDst[3] = v[3] / k; + return newDst; + } + /** + * Inverse a vector. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The inverted vector. + */ + function inverse(v, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = 1 / v[0]; + newDst[1] = 1 / v[1]; + newDst[2] = 1 / v[2]; + newDst[3] = 1 / v[3]; + return newDst; + } + /** + * Invert a vector. (same as inverse) + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The inverted vector. + */ + const invert = inverse; + /** + * Computes the dot product of two vectors + * @param a - Operand vector. + * @param b - Operand vector. + * @returns dot product + */ + function dot(a, b) { + return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]); + } + /** + * Computes the length of vector + * @param v - vector. + * @returns length of vector. + */ + function length(v) { + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const v3 = v[3]; + return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3); + } + /** + * Computes the length of vector (same as length) + * @param v - vector. + * @returns length of vector. + */ + const len = length; + /** + * Computes the square of the length of vector + * @param v - vector. + * @returns square of the length of vector. + */ + function lengthSq(v) { + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const v3 = v[3]; + return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3; + } + /** + * Computes the square of the length of vector (same as lengthSq) + * @param v - vector. + * @returns square of the length of vector. + */ + const lenSq = lengthSq; + /** + * Computes the distance between 2 points + * @param a - vector. + * @param b - vector. + * @returns distance between a and b + */ + function distance(a, b) { + const dx = a[0] - b[0]; + const dy = a[1] - b[1]; + const dz = a[2] - b[2]; + const dw = a[3] - b[3]; + return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); + } + /** + * Computes the distance between 2 points (same as distance) + * @param a - vector. + * @param b - vector. + * @returns distance between a and b + */ + const dist = distance; + /** + * Computes the square of the distance between 2 points + * @param a - vector. + * @param b - vector. + * @returns square of the distance between a and b + */ + function distanceSq(a, b) { + const dx = a[0] - b[0]; + const dy = a[1] - b[1]; + const dz = a[2] - b[2]; + const dw = a[3] - b[3]; + return dx * dx + dy * dy + dz * dz + dw * dw; + } + /** + * Computes the square of the distance between 2 points (same as distanceSq) + * @param a - vector. + * @param b - vector. + * @returns square of the distance between a and b + */ + const distSq = distanceSq; + /** + * Divides a vector by its Euclidean length and returns the quotient. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The normalized vector. + */ + function normalize(v, dst) { + const newDst = (dst ?? new Ctor(4)); + const v0 = v[0]; + const v1 = v[1]; + const v2 = v[2]; + const v3 = v[3]; + const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3); + if (len > 0.00001) { + newDst[0] = v0 / len; + newDst[1] = v1 / len; + newDst[2] = v2 / len; + newDst[3] = v3 / len; + } + else { + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + } + return newDst; + } + /** + * Negates a vector. + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns -v. + */ + function negate(v, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = -v[0]; + newDst[1] = -v[1]; + newDst[2] = -v[2]; + newDst[3] = -v[3]; + return newDst; + } + /** + * Copies a vector. (same as {@link vec4.clone}) + * Also see {@link vec4.create} and {@link vec4.set} + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A copy of v. + */ + function copy(v, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = v[0]; + newDst[1] = v[1]; + newDst[2] = v[2]; + newDst[3] = v[3]; + return newDst; + } + /** + * Clones a vector. (same as {@link vec4.copy}) + * Also see {@link vec4.create} and {@link vec4.set} + * @param v - The vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns A copy of v. + */ + const clone = copy; + /** + * Multiplies a vector by another vector (component-wise); assumes a and + * b have the same length. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of products of entries of a and b. + */ + function multiply(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] * b[0]; + newDst[1] = a[1] * b[1]; + newDst[2] = a[2] * b[2]; + newDst[3] = a[3] * b[3]; + return newDst; + } + /** + * Multiplies a vector by another vector (component-wise); assumes a and + * b have the same length. (same as mul) + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of products of entries of a and b. + */ + const mul = multiply; + /** + * Divides a vector by another vector (component-wise); assumes a and + * b have the same length. + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of quotients of entries of a and b. + */ + function divide(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = a[0] / b[0]; + newDst[1] = a[1] / b[1]; + newDst[2] = a[2] / b[2]; + newDst[3] = a[3] / b[3]; + return newDst; + } + /** + * Divides a vector by another vector (component-wise); assumes a and + * b have the same length. (same as divide) + * @param a - Operand vector. + * @param b - Operand vector. + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The vector of quotients of entries of a and b. + */ + const div = divide; + /** + * Zero's a vector + * @param dst - vector to hold result. If not passed in a new one is created. + * @returns The zeroed vector. + */ + function zero(dst) { + const newDst = (dst ?? new Ctor(4)); + newDst[0] = 0; + newDst[1] = 0; + newDst[2] = 0; + newDst[3] = 0; + return newDst; + } + /** + * transform vec4 by 4x4 matrix + * @param v - the vector + * @param m - The matrix. + * @param dst - optional vec4 to store result. If not passed a new one is created. + * @returns the transformed vector + */ + function transformMat4(v, m, dst) { + const newDst = (dst ?? new Ctor(4)); + const x = v[0]; + const y = v[1]; + const z = v[2]; + const w = v[3]; + newDst[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + newDst[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + return newDst; + } + /** + * Treat a 4D vector as a direction and set it's length + * + * @param a The vec4 to lengthen + * @param len The length of the resulting vector + * @returns The lengthened vector + */ + function setLength(a, len, dst) { + const newDst = (dst ?? new Ctor(4)); + normalize(a, newDst); + return mulScalar(newDst, len, newDst); + } + /** + * Ensure a vector is not longer than a max length + * + * @param a The vec4 to limit + * @param maxLen The longest length of the resulting vector + * @returns The vector, shortened to maxLen if it's too long + */ + function truncate(a, maxLen, dst) { + const newDst = (dst ?? new Ctor(4)); + if (length(a) > maxLen) { + return setLength(a, maxLen, newDst); + } + return copy(a, newDst); + } + /** + * Return the vector exactly between 2 endpoint vectors + * + * @param a Endpoint 1 + * @param b Endpoint 2 + * @returns The vector exactly residing between endpoints 1 and 2 + */ + function midpoint(a, b, dst) { + const newDst = (dst ?? new Ctor(4)); + return lerp(a, b, 0.5, newDst); + } + return { + create, + fromValues, + set, + ceil, + floor, + round, + clamp, + add, + addScaled, + subtract, + sub, + equalsApproximately, + equals, + lerp, + lerpV, + max, + min, + mulScalar, + scale, + divScalar, + inverse, + invert, + dot, + length, + len, + lengthSq, + lenSq, + distance, + dist, + distanceSq, + distSq, + normalize, + negate, + copy, + clone, + multiply, + mul, + divide, + div, + zero, + transformMat4, + setLength, + truncate, + midpoint, + }; +} +const cache = new Map(); +/** + * + * Vec4 math functions. + * + * Almost all functions take an optional `newDst` argument. If it is not passed in the + * functions will create a new `Vec4`. In other words you can do this + * + * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2. + * + * or + * + * const v = vec4.create(); + * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v + * + * The first style is often easier but depending on where it's used it generates garbage where + * as there is almost never allocation with the second style. + * + * It is always safe to pass any vector as the destination. So for example + * + * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1 + * + */ +function getAPI(Ctor) { + let api = cache.get(Ctor); + if (!api) { + api = getAPIImpl(Ctor); + cache.set(Ctor, api); + } + return api; +} + +/** + * Some docs + * @namespace wgpu-matrix + */ +/** + * Generate wgpu-matrix API for type + */ +function wgpuMatrixAPI(Mat3Ctor, Mat4Ctor, QuatCtor, Vec2Ctor, Vec3Ctor, Vec4Ctor) { + return { + /** @namespace mat3 */ + mat3: getAPI$3(Mat3Ctor), + /** @namespace mat4 */ + mat4: getAPI$2(Mat4Ctor), + /** @namespace quat */ + quat: getAPI$1(QuatCtor), + /** @namespace vec2 */ + vec2: getAPI$5(Vec2Ctor), + /** @namespace vec3 */ + vec3: getAPI$4(Vec3Ctor), + /** @namespace vec4 */ + vec4: getAPI(Vec4Ctor), + }; +} +const { +/** + * 3x3 Matrix functions that default to returning `Float32Array` + * @namespace + */ +mat3, +/** + * 4x4 Matrix functions that default to returning `Float32Array` + * @namespace + */ +mat4, +/** + * Quaternion functions that default to returning `Float32Array` + * @namespace + */ +quat, +/** + * Vec2 functions that default to returning `Float32Array` + * @namespace + */ +vec2, +/** + * Vec3 functions that default to returning `Float32Array` + * @namespace + */ +vec3, +/** + * Vec3 functions that default to returning `Float32Array` + * @namespace + */ +vec4, } = wgpuMatrixAPI(Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array); +wgpuMatrixAPI(Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array); +wgpuMatrixAPI(ZeroArray, Array, Array, Array, Array, Array); + +/** + * dat-gui JavaScript Controller Library + * https://github.com/dataarts/dat.gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +function ___$insertStyle(css) { + if (typeof window === 'undefined') { + return; + } + + var style = document.createElement('style'); + + style.setAttribute('type', 'text/css'); + style.innerHTML = css; + document.head.appendChild(style); + + return css; +} + +function colorToString (color, forceCSSHex) { + var colorFormat = color.__state.conversionName.toString(); + var r = Math.round(color.r); + var g = Math.round(color.g); + var b = Math.round(color.b); + var a = color.a; + var h = Math.round(color.h); + var s = color.s.toFixed(1); + var v = color.v.toFixed(1); + if (forceCSSHex || colorFormat === 'THREE_CHAR_HEX' || colorFormat === 'SIX_CHAR_HEX') { + var str = color.hex.toString(16); + while (str.length < 6) { + str = '0' + str; + } + return '#' + str; + } else if (colorFormat === 'CSS_RGB') { + return 'rgb(' + r + ',' + g + ',' + b + ')'; + } else if (colorFormat === 'CSS_RGBA') { + return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + } else if (colorFormat === 'HEX') { + return '0x' + color.hex.toString(16); + } else if (colorFormat === 'RGB_ARRAY') { + return '[' + r + ',' + g + ',' + b + ']'; + } else if (colorFormat === 'RGBA_ARRAY') { + return '[' + r + ',' + g + ',' + b + ',' + a + ']'; + } else if (colorFormat === 'RGB_OBJ') { + return '{r:' + r + ',g:' + g + ',b:' + b + '}'; + } else if (colorFormat === 'RGBA_OBJ') { + return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}'; + } else if (colorFormat === 'HSV_OBJ') { + return '{h:' + h + ',s:' + s + ',v:' + v + '}'; + } else if (colorFormat === 'HSVA_OBJ') { + return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}'; + } + return 'unknown format'; +} + +var ARR_EACH = Array.prototype.forEach; +var ARR_SLICE = Array.prototype.slice; +var Common = { + BREAK: {}, + extend: function extend(target) { + this.each(ARR_SLICE.call(arguments, 1), function (obj) { + var keys = this.isObject(obj) ? Object.keys(obj) : []; + keys.forEach(function (key) { + if (!this.isUndefined(obj[key])) { + target[key] = obj[key]; + } + }.bind(this)); + }, this); + return target; + }, + defaults: function defaults(target) { + this.each(ARR_SLICE.call(arguments, 1), function (obj) { + var keys = this.isObject(obj) ? Object.keys(obj) : []; + keys.forEach(function (key) { + if (this.isUndefined(target[key])) { + target[key] = obj[key]; + } + }.bind(this)); + }, this); + return target; + }, + compose: function compose() { + var toCall = ARR_SLICE.call(arguments); + return function () { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length - 1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + }; + }, + each: function each(obj, itr, scope) { + if (!obj) { + return; + } + if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) { + obj.forEach(itr, scope); + } else if (obj.length === obj.length + 0) { + var key = void 0; + var l = void 0; + for (key = 0, l = obj.length; key < l; key++) { + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) { + return; + } + } + } else { + for (var _key in obj) { + if (itr.call(scope, obj[_key], _key) === this.BREAK) { + return; + } + } + } + }, + defer: function defer(fnc) { + setTimeout(fnc, 0); + }, + debounce: function debounce(func, threshold, callImmediately) { + var timeout = void 0; + return function () { + var obj = this; + var args = arguments; + function delayed() { + timeout = null; + if (!callImmediately) func.apply(obj, args); + } + var callNow = callImmediately || !timeout; + clearTimeout(timeout); + timeout = setTimeout(delayed, threshold); + if (callNow) { + func.apply(obj, args); + } + }; + }, + toArray: function toArray(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + isUndefined: function isUndefined(obj) { + return obj === undefined; + }, + isNull: function isNull(obj) { + return obj === null; + }, + isNaN: function (_isNaN) { + function isNaN(_x) { + return _isNaN.apply(this, arguments); + } + isNaN.toString = function () { + return _isNaN.toString(); + }; + return isNaN; + }(function (obj) { + return isNaN(obj); + }), + isArray: Array.isArray || function (obj) { + return obj.constructor === Array; + }, + isObject: function isObject(obj) { + return obj === Object(obj); + }, + isNumber: function isNumber(obj) { + return obj === obj + 0; + }, + isString: function isString(obj) { + return obj === obj + ''; + }, + isBoolean: function isBoolean(obj) { + return obj === false || obj === true; + }, + isFunction: function isFunction(obj) { + return obj instanceof Function; + } +}; + +var INTERPRETATIONS = [ +{ + litmus: Common.isString, + conversions: { + THREE_CHAR_HEX: { + read: function read(original) { + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) { + return false; + } + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString() + test[1].toString() + test[2].toString() + test[2].toString() + test[3].toString() + test[3].toString(), 0) + }; + }, + write: colorToString + }, + SIX_CHAR_HEX: { + read: function read(original) { + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) { + return false; + } + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString(), 0) + }; + }, + write: colorToString + }, + CSS_RGB: { + read: function read(original) { + var test = original.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/); + if (test === null) { + return false; + } + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + }, + write: colorToString + }, + CSS_RGBA: { + read: function read(original) { + var test = original.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/); + if (test === null) { + return false; + } + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + }, + write: colorToString + } + } +}, +{ + litmus: Common.isNumber, + conversions: { + HEX: { + read: function read(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + }; + }, + write: function write(color) { + return color.hex; + } + } + } +}, +{ + litmus: Common.isArray, + conversions: { + RGB_ARRAY: { + read: function read(original) { + if (original.length !== 3) { + return false; + } + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + write: function write(color) { + return [color.r, color.g, color.b]; + } + }, + RGBA_ARRAY: { + read: function read(original) { + if (original.length !== 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + write: function write(color) { + return [color.r, color.g, color.b, color.a]; + } + } + } +}, +{ + litmus: Common.isObject, + conversions: { + RGBA_OBJ: { + read: function read(original) { + if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b) && Common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + }; + } + return false; + }, + write: function write(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + }; + } + }, + RGB_OBJ: { + read: function read(original) { + if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + }; + } + return false; + }, + write: function write(color) { + return { + r: color.r, + g: color.g, + b: color.b + }; + } + }, + HSVA_OBJ: { + read: function read(original) { + if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v) && Common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + }; + } + return false; + }, + write: function write(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + }; + } + }, + HSV_OBJ: { + read: function read(original) { + if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + }; + } + return false; + }, + write: function write(color) { + return { + h: color.h, + s: color.s, + v: color.v + }; + } + } + } +}]; +var result = void 0; +var toReturn = void 0; +var interpret = function interpret() { + toReturn = false; + var original = arguments.length > 1 ? Common.toArray(arguments) : arguments[0]; + Common.each(INTERPRETATIONS, function (family) { + if (family.litmus(original)) { + Common.each(family.conversions, function (conversion, conversionName) { + result = conversion.read(original); + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return Common.BREAK; + } + }); + return Common.BREAK; + } + }); + return toReturn; +}; + +var tmpComponent = void 0; +var ColorMath = { + hsv_to_rgb: function hsv_to_rgb(h, s, v) { + var hi = Math.floor(h / 60) % 6; + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - f * s); + var t = v * (1.0 - (1.0 - f) * s); + var c = [[v, t, p], [q, v, p], [p, v, t], [p, q, v], [t, p, v], [v, p, q]][hi]; + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + }, + rgb_to_hsv: function rgb_to_hsv(r, g, b) { + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h = void 0; + var s = void 0; + if (max !== 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + rgb_to_hex: function rgb_to_hex(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + component_from_hex: function component_from_hex(hex, componentIndex) { + return hex >> componentIndex * 8 & 0xFF; + }, + hex_with_component: function hex_with_component(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | hex & ~(0xFF << tmpComponent); + } +}; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + + + + + + + + + + + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + + + +var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +}; + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + + + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +var Color = function () { + function Color() { + classCallCheck(this, Color); + this.__state = interpret.apply(this, arguments); + if (this.__state === false) { + throw new Error('Failed to interpret color arguments'); + } + this.__state.a = this.__state.a || 1; + } + createClass(Color, [{ + key: 'toString', + value: function toString() { + return colorToString(this); + } + }, { + key: 'toHexString', + value: function toHexString() { + return colorToString(this, true); + } + }, { + key: 'toOriginal', + value: function toOriginal() { + return this.__state.conversion.write(this); + } + }]); + return Color; +}(); +function defineRGBComponent(target, component, componentHexIndex) { + Object.defineProperty(target, component, { + get: function get$$1() { + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + Color.recalculateRGB(this, component, componentHexIndex); + return this.__state[component]; + }, + set: function set$$1(v) { + if (this.__state.space !== 'RGB') { + Color.recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + this.__state[component] = v; + } + }); +} +function defineHSVComponent(target, component) { + Object.defineProperty(target, component, { + get: function get$$1() { + if (this.__state.space === 'HSV') { + return this.__state[component]; + } + Color.recalculateHSV(this); + return this.__state[component]; + }, + set: function set$$1(v) { + if (this.__state.space !== 'HSV') { + Color.recalculateHSV(this); + this.__state.space = 'HSV'; + } + this.__state[component] = v; + } + }); +} +Color.recalculateRGB = function (color, component, componentHexIndex) { + if (color.__state.space === 'HEX') { + color.__state[component] = ColorMath.component_from_hex(color.__state.hex, componentHexIndex); + } else if (color.__state.space === 'HSV') { + Common.extend(color.__state, ColorMath.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + } else { + throw new Error('Corrupted color state'); + } +}; +Color.recalculateHSV = function (color) { + var result = ColorMath.rgb_to_hsv(color.r, color.g, color.b); + Common.extend(color.__state, { + s: result.s, + v: result.v + }); + if (!Common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (Common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } +}; +Color.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']; +defineRGBComponent(Color.prototype, 'r', 2); +defineRGBComponent(Color.prototype, 'g', 1); +defineRGBComponent(Color.prototype, 'b', 0); +defineHSVComponent(Color.prototype, 'h'); +defineHSVComponent(Color.prototype, 's'); +defineHSVComponent(Color.prototype, 'v'); +Object.defineProperty(Color.prototype, 'a', { + get: function get$$1() { + return this.__state.a; + }, + set: function set$$1(v) { + this.__state.a = v; + } +}); +Object.defineProperty(Color.prototype, 'hex', { + get: function get$$1() { + if (this.__state.space !== 'HEX') { + this.__state.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b); + this.__state.space = 'HEX'; + } + return this.__state.hex; + }, + set: function set$$1(v) { + this.__state.space = 'HEX'; + this.__state.hex = v; + } +}); + +var Controller = function () { + function Controller(object, property) { + classCallCheck(this, Controller); + this.initialValue = object[property]; + this.domElement = document.createElement('div'); + this.object = object; + this.property = property; + this.__onChange = undefined; + this.__onFinishChange = undefined; + } + createClass(Controller, [{ + key: 'onChange', + value: function onChange(fnc) { + this.__onChange = fnc; + return this; + } + }, { + key: 'onFinishChange', + value: function onFinishChange(fnc) { + this.__onFinishChange = fnc; + return this; + } + }, { + key: 'setValue', + value: function setValue(newValue) { + this.object[this.property] = newValue; + if (this.__onChange) { + this.__onChange.call(this, newValue); + } + this.updateDisplay(); + return this; + } + }, { + key: 'getValue', + value: function getValue() { + return this.object[this.property]; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + return this; + } + }, { + key: 'isModified', + value: function isModified() { + return this.initialValue !== this.getValue(); + } + }]); + return Controller; +}(); + +var EVENT_MAP = { + HTMLEvents: ['change'], + MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'], + KeyboardEvents: ['keydown'] +}; +var EVENT_MAP_INV = {}; +Common.each(EVENT_MAP, function (v, k) { + Common.each(v, function (e) { + EVENT_MAP_INV[e] = k; + }); +}); +var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/; +function cssValueToPixels(val) { + if (val === '0' || Common.isUndefined(val)) { + return 0; + } + var match = val.match(CSS_VALUE_PIXELS); + if (!Common.isNull(match)) { + return parseFloat(match[1]); + } + return 0; +} +var dom = { + makeSelectable: function makeSelectable(elem, selectable) { + if (elem === undefined || elem.style === undefined) return; + elem.onselectstart = selectable ? function () { + return false; + } : function () {}; + elem.style.MozUserSelect = selectable ? 'auto' : 'none'; + elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none'; + elem.unselectable = selectable ? 'on' : 'off'; + }, + makeFullscreen: function makeFullscreen(elem, hor, vert) { + var vertical = vert; + var horizontal = hor; + if (Common.isUndefined(horizontal)) { + horizontal = true; + } + if (Common.isUndefined(vertical)) { + vertical = true; + } + elem.style.position = 'absolute'; + if (horizontal) { + elem.style.left = 0; + elem.style.right = 0; + } + if (vertical) { + elem.style.top = 0; + elem.style.bottom = 0; + } + }, + fakeEvent: function fakeEvent(elem, eventType, pars, aux) { + var params = pars || {}; + var className = EVENT_MAP_INV[eventType]; + if (!className) { + throw new Error('Event type ' + eventType + ' not supported.'); + } + var evt = document.createEvent(className); + switch (className) { + case 'MouseEvents': + { + var clientX = params.x || params.clientX || 0; + var clientY = params.y || params.clientY || 0; + evt.initMouseEvent(eventType, params.bubbles || false, params.cancelable || true, window, params.clickCount || 1, 0, + 0, + clientX, + clientY, + false, false, false, false, 0, null); + break; + } + case 'KeyboardEvents': + { + var init = evt.initKeyboardEvent || evt.initKeyEvent; + Common.defaults(params, { + cancelable: true, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: undefined, + charCode: undefined + }); + init(eventType, params.bubbles || false, params.cancelable, window, params.ctrlKey, params.altKey, params.shiftKey, params.metaKey, params.keyCode, params.charCode); + break; + } + default: + { + evt.initEvent(eventType, params.bubbles || false, params.cancelable || true); + break; + } + } + Common.defaults(evt, aux); + elem.dispatchEvent(evt); + }, + bind: function bind(elem, event, func, newBool) { + var bool = newBool || false; + if (elem.addEventListener) { + elem.addEventListener(event, func, bool); + } else if (elem.attachEvent) { + elem.attachEvent('on' + event, func); + } + return dom; + }, + unbind: function unbind(elem, event, func, newBool) { + var bool = newBool || false; + if (elem.removeEventListener) { + elem.removeEventListener(event, func, bool); + } else if (elem.detachEvent) { + elem.detachEvent('on' + event, func); + } + return dom; + }, + addClass: function addClass(elem, className) { + if (elem.className === undefined) { + elem.className = className; + } else if (elem.className !== className) { + var classes = elem.className.split(/ +/); + if (classes.indexOf(className) === -1) { + classes.push(className); + elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, ''); + } + } + return dom; + }, + removeClass: function removeClass(elem, className) { + if (className) { + if (elem.className === className) { + elem.removeAttribute('class'); + } else { + var classes = elem.className.split(/ +/); + var index = classes.indexOf(className); + if (index !== -1) { + classes.splice(index, 1); + elem.className = classes.join(' '); + } + } + } else { + elem.className = undefined; + } + return dom; + }, + hasClass: function hasClass(elem, className) { + return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false; + }, + getWidth: function getWidth(elem) { + var style = getComputedStyle(elem); + return cssValueToPixels(style['border-left-width']) + cssValueToPixels(style['border-right-width']) + cssValueToPixels(style['padding-left']) + cssValueToPixels(style['padding-right']) + cssValueToPixels(style.width); + }, + getHeight: function getHeight(elem) { + var style = getComputedStyle(elem); + return cssValueToPixels(style['border-top-width']) + cssValueToPixels(style['border-bottom-width']) + cssValueToPixels(style['padding-top']) + cssValueToPixels(style['padding-bottom']) + cssValueToPixels(style.height); + }, + getOffset: function getOffset(el) { + var elem = el; + var offset = { left: 0, top: 0 }; + if (elem.offsetParent) { + do { + offset.left += elem.offsetLeft; + offset.top += elem.offsetTop; + elem = elem.offsetParent; + } while (elem); + } + return offset; + }, + isActive: function isActive(elem) { + return elem === document.activeElement && (elem.type || elem.href); + } +}; + +var BooleanController = function (_Controller) { + inherits(BooleanController, _Controller); + function BooleanController(object, property) { + classCallCheck(this, BooleanController); + var _this2 = possibleConstructorReturn(this, (BooleanController.__proto__ || Object.getPrototypeOf(BooleanController)).call(this, object, property)); + var _this = _this2; + _this2.__prev = _this2.getValue(); + _this2.__checkbox = document.createElement('input'); + _this2.__checkbox.setAttribute('type', 'checkbox'); + function onChange() { + _this.setValue(!_this.__prev); + } + dom.bind(_this2.__checkbox, 'change', onChange, false); + _this2.domElement.appendChild(_this2.__checkbox); + _this2.updateDisplay(); + return _this2; + } + createClass(BooleanController, [{ + key: 'setValue', + value: function setValue(v) { + var toReturn = get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'setValue', this).call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.__prev = this.getValue(); + return toReturn; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + if (this.getValue() === true) { + this.__checkbox.setAttribute('checked', 'checked'); + this.__checkbox.checked = true; + this.__prev = true; + } else { + this.__checkbox.checked = false; + this.__prev = false; + } + return get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'updateDisplay', this).call(this); + } + }]); + return BooleanController; +}(Controller); + +var OptionController = function (_Controller) { + inherits(OptionController, _Controller); + function OptionController(object, property, opts) { + classCallCheck(this, OptionController); + var _this2 = possibleConstructorReturn(this, (OptionController.__proto__ || Object.getPrototypeOf(OptionController)).call(this, object, property)); + var options = opts; + var _this = _this2; + _this2.__select = document.createElement('select'); + if (Common.isArray(options)) { + var map = {}; + Common.each(options, function (element) { + map[element] = element; + }); + options = map; + } + Common.each(options, function (value, key) { + var opt = document.createElement('option'); + opt.innerHTML = key; + opt.setAttribute('value', value); + _this.__select.appendChild(opt); + }); + _this2.updateDisplay(); + dom.bind(_this2.__select, 'change', function () { + var desiredValue = this.options[this.selectedIndex].value; + _this.setValue(desiredValue); + }); + _this2.domElement.appendChild(_this2.__select); + return _this2; + } + createClass(OptionController, [{ + key: 'setValue', + value: function setValue(v) { + var toReturn = get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'setValue', this).call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + return toReturn; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + if (dom.isActive(this.__select)) return this; + this.__select.value = this.getValue(); + return get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'updateDisplay', this).call(this); + } + }]); + return OptionController; +}(Controller); + +var StringController = function (_Controller) { + inherits(StringController, _Controller); + function StringController(object, property) { + classCallCheck(this, StringController); + var _this2 = possibleConstructorReturn(this, (StringController.__proto__ || Object.getPrototypeOf(StringController)).call(this, object, property)); + var _this = _this2; + function onChange() { + _this.setValue(_this.__input.value); + } + function onBlur() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + _this2.__input = document.createElement('input'); + _this2.__input.setAttribute('type', 'text'); + dom.bind(_this2.__input, 'keyup', onChange); + dom.bind(_this2.__input, 'change', onChange); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + this.blur(); + } + }); + _this2.updateDisplay(); + _this2.domElement.appendChild(_this2.__input); + return _this2; + } + createClass(StringController, [{ + key: 'updateDisplay', + value: function updateDisplay() { + if (!dom.isActive(this.__input)) { + this.__input.value = this.getValue(); + } + return get(StringController.prototype.__proto__ || Object.getPrototypeOf(StringController.prototype), 'updateDisplay', this).call(this); + } + }]); + return StringController; +}(Controller); + +function numDecimals(x) { + var _x = x.toString(); + if (_x.indexOf('.') > -1) { + return _x.length - _x.indexOf('.') - 1; + } + return 0; +} +var NumberController = function (_Controller) { + inherits(NumberController, _Controller); + function NumberController(object, property, params) { + classCallCheck(this, NumberController); + var _this = possibleConstructorReturn(this, (NumberController.__proto__ || Object.getPrototypeOf(NumberController)).call(this, object, property)); + var _params = params || {}; + _this.__min = _params.min; + _this.__max = _params.max; + _this.__step = _params.step; + if (Common.isUndefined(_this.__step)) { + if (_this.initialValue === 0) { + _this.__impliedStep = 1; + } else { + _this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(_this.initialValue)) / Math.LN10)) / 10; + } + } else { + _this.__impliedStep = _this.__step; + } + _this.__precision = numDecimals(_this.__impliedStep); + return _this; + } + createClass(NumberController, [{ + key: 'setValue', + value: function setValue(v) { + var _v = v; + if (this.__min !== undefined && _v < this.__min) { + _v = this.__min; + } else if (this.__max !== undefined && _v > this.__max) { + _v = this.__max; + } + if (this.__step !== undefined && _v % this.__step !== 0) { + _v = Math.round(_v / this.__step) * this.__step; + } + return get(NumberController.prototype.__proto__ || Object.getPrototypeOf(NumberController.prototype), 'setValue', this).call(this, _v); + } + }, { + key: 'min', + value: function min(minValue) { + this.__min = minValue; + return this; + } + }, { + key: 'max', + value: function max(maxValue) { + this.__max = maxValue; + return this; + } + }, { + key: 'step', + value: function step(stepValue) { + this.__step = stepValue; + this.__impliedStep = stepValue; + this.__precision = numDecimals(stepValue); + return this; + } + }]); + return NumberController; +}(Controller); + +function roundToDecimal(value, decimals) { + var tenTo = Math.pow(10, decimals); + return Math.round(value * tenTo) / tenTo; +} +var NumberControllerBox = function (_NumberController) { + inherits(NumberControllerBox, _NumberController); + function NumberControllerBox(object, property, params) { + classCallCheck(this, NumberControllerBox); + var _this2 = possibleConstructorReturn(this, (NumberControllerBox.__proto__ || Object.getPrototypeOf(NumberControllerBox)).call(this, object, property, params)); + _this2.__truncationSuspended = false; + var _this = _this2; + var prevY = void 0; + function onChange() { + var attempted = parseFloat(_this.__input.value); + if (!Common.isNaN(attempted)) { + _this.setValue(attempted); + } + } + function onFinish() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + function onBlur() { + onFinish(); + } + function onMouseDrag(e) { + var diff = prevY - e.clientY; + _this.setValue(_this.getValue() + diff * _this.__impliedStep); + prevY = e.clientY; + } + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + onFinish(); + } + function onMouseDown(e) { + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + prevY = e.clientY; + } + _this2.__input = document.createElement('input'); + _this2.__input.setAttribute('type', 'text'); + dom.bind(_this2.__input, 'change', onChange); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__input, 'mousedown', onMouseDown); + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + _this.__truncationSuspended = true; + this.blur(); + _this.__truncationSuspended = false; + onFinish(); + } + }); + _this2.updateDisplay(); + _this2.domElement.appendChild(_this2.__input); + return _this2; + } + createClass(NumberControllerBox, [{ + key: 'updateDisplay', + value: function updateDisplay() { + this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); + return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this); + } + }]); + return NumberControllerBox; +}(NumberController); + +function map(v, i1, i2, o1, o2) { + return o1 + (o2 - o1) * ((v - i1) / (i2 - i1)); +} +var NumberControllerSlider = function (_NumberController) { + inherits(NumberControllerSlider, _NumberController); + function NumberControllerSlider(object, property, min, max, step) { + classCallCheck(this, NumberControllerSlider); + var _this2 = possibleConstructorReturn(this, (NumberControllerSlider.__proto__ || Object.getPrototypeOf(NumberControllerSlider)).call(this, object, property, { min: min, max: max, step: step })); + var _this = _this2; + _this2.__background = document.createElement('div'); + _this2.__foreground = document.createElement('div'); + dom.bind(_this2.__background, 'mousedown', onMouseDown); + dom.bind(_this2.__background, 'touchstart', onTouchStart); + dom.addClass(_this2.__background, 'slider'); + dom.addClass(_this2.__foreground, 'slider-fg'); + function onMouseDown(e) { + document.activeElement.blur(); + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + onMouseDrag(e); + } + function onMouseDrag(e) { + e.preventDefault(); + var bgRect = _this.__background.getBoundingClientRect(); + _this.setValue(map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); + return false; + } + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + function onTouchStart(e) { + if (e.touches.length !== 1) { + return; + } + dom.bind(window, 'touchmove', onTouchMove); + dom.bind(window, 'touchend', onTouchEnd); + onTouchMove(e); + } + function onTouchMove(e) { + var clientX = e.touches[0].clientX; + var bgRect = _this.__background.getBoundingClientRect(); + _this.setValue(map(clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); + } + function onTouchEnd() { + dom.unbind(window, 'touchmove', onTouchMove); + dom.unbind(window, 'touchend', onTouchEnd); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + _this2.updateDisplay(); + _this2.__background.appendChild(_this2.__foreground); + _this2.domElement.appendChild(_this2.__background); + return _this2; + } + createClass(NumberControllerSlider, [{ + key: 'updateDisplay', + value: function updateDisplay() { + var pct = (this.getValue() - this.__min) / (this.__max - this.__min); + this.__foreground.style.width = pct * 100 + '%'; + return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this); + } + }]); + return NumberControllerSlider; +}(NumberController); + +var FunctionController = function (_Controller) { + inherits(FunctionController, _Controller); + function FunctionController(object, property, text) { + classCallCheck(this, FunctionController); + var _this2 = possibleConstructorReturn(this, (FunctionController.__proto__ || Object.getPrototypeOf(FunctionController)).call(this, object, property)); + var _this = _this2; + _this2.__button = document.createElement('div'); + _this2.__button.innerHTML = text === undefined ? 'Fire' : text; + dom.bind(_this2.__button, 'click', function (e) { + e.preventDefault(); + _this.fire(); + return false; + }); + dom.addClass(_this2.__button, 'button'); + _this2.domElement.appendChild(_this2.__button); + return _this2; + } + createClass(FunctionController, [{ + key: 'fire', + value: function fire() { + if (this.__onChange) { + this.__onChange.call(this); + } + this.getValue().call(this.object); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + } + }]); + return FunctionController; +}(Controller); + +var ColorController = function (_Controller) { + inherits(ColorController, _Controller); + function ColorController(object, property) { + classCallCheck(this, ColorController); + var _this2 = possibleConstructorReturn(this, (ColorController.__proto__ || Object.getPrototypeOf(ColorController)).call(this, object, property)); + _this2.__color = new Color(_this2.getValue()); + _this2.__temp = new Color(0); + var _this = _this2; + _this2.domElement = document.createElement('div'); + dom.makeSelectable(_this2.domElement, false); + _this2.__selector = document.createElement('div'); + _this2.__selector.className = 'selector'; + _this2.__saturation_field = document.createElement('div'); + _this2.__saturation_field.className = 'saturation-field'; + _this2.__field_knob = document.createElement('div'); + _this2.__field_knob.className = 'field-knob'; + _this2.__field_knob_border = '2px solid '; + _this2.__hue_knob = document.createElement('div'); + _this2.__hue_knob.className = 'hue-knob'; + _this2.__hue_field = document.createElement('div'); + _this2.__hue_field.className = 'hue-field'; + _this2.__input = document.createElement('input'); + _this2.__input.type = 'text'; + _this2.__input_textShadow = '0 1px 1px '; + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + onBlur.call(this); + } + }); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__selector, 'mousedown', function () { + dom.addClass(this, 'drag').bind(window, 'mouseup', function () { + dom.removeClass(_this.__selector, 'drag'); + }); + }); + dom.bind(_this2.__selector, 'touchstart', function () { + dom.addClass(this, 'drag').bind(window, 'touchend', function () { + dom.removeClass(_this.__selector, 'drag'); + }); + }); + var valueField = document.createElement('div'); + Common.extend(_this2.__selector.style, { + width: '122px', + height: '102px', + padding: '3px', + backgroundColor: '#222', + boxShadow: '0px 1px 3px rgba(0,0,0,0.3)' + }); + Common.extend(_this2.__field_knob.style, { + position: 'absolute', + width: '12px', + height: '12px', + border: _this2.__field_knob_border + (_this2.__color.v < 0.5 ? '#fff' : '#000'), + boxShadow: '0px 1px 3px rgba(0,0,0,0.5)', + borderRadius: '12px', + zIndex: 1 + }); + Common.extend(_this2.__hue_knob.style, { + position: 'absolute', + width: '15px', + height: '2px', + borderRight: '4px solid #fff', + zIndex: 1 + }); + Common.extend(_this2.__saturation_field.style, { + width: '100px', + height: '100px', + border: '1px solid #555', + marginRight: '3px', + display: 'inline-block', + cursor: 'pointer' + }); + Common.extend(valueField.style, { + width: '100%', + height: '100%', + background: 'none' + }); + linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000'); + Common.extend(_this2.__hue_field.style, { + width: '15px', + height: '100px', + border: '1px solid #555', + cursor: 'ns-resize', + position: 'absolute', + top: '3px', + right: '3px' + }); + hueGradient(_this2.__hue_field); + Common.extend(_this2.__input.style, { + outline: 'none', + textAlign: 'center', + color: '#fff', + border: 0, + fontWeight: 'bold', + textShadow: _this2.__input_textShadow + 'rgba(0,0,0,0.7)' + }); + dom.bind(_this2.__saturation_field, 'mousedown', fieldDown); + dom.bind(_this2.__saturation_field, 'touchstart', fieldDown); + dom.bind(_this2.__field_knob, 'mousedown', fieldDown); + dom.bind(_this2.__field_knob, 'touchstart', fieldDown); + dom.bind(_this2.__hue_field, 'mousedown', fieldDownH); + dom.bind(_this2.__hue_field, 'touchstart', fieldDownH); + function fieldDown(e) { + setSV(e); + dom.bind(window, 'mousemove', setSV); + dom.bind(window, 'touchmove', setSV); + dom.bind(window, 'mouseup', fieldUpSV); + dom.bind(window, 'touchend', fieldUpSV); + } + function fieldDownH(e) { + setH(e); + dom.bind(window, 'mousemove', setH); + dom.bind(window, 'touchmove', setH); + dom.bind(window, 'mouseup', fieldUpH); + dom.bind(window, 'touchend', fieldUpH); + } + function fieldUpSV() { + dom.unbind(window, 'mousemove', setSV); + dom.unbind(window, 'touchmove', setSV); + dom.unbind(window, 'mouseup', fieldUpSV); + dom.unbind(window, 'touchend', fieldUpSV); + onFinish(); + } + function fieldUpH() { + dom.unbind(window, 'mousemove', setH); + dom.unbind(window, 'touchmove', setH); + dom.unbind(window, 'mouseup', fieldUpH); + dom.unbind(window, 'touchend', fieldUpH); + onFinish(); + } + function onBlur() { + var i = interpret(this.value); + if (i !== false) { + _this.__color.__state = i; + _this.setValue(_this.__color.toOriginal()); + } else { + this.value = _this.__color.toString(); + } + } + function onFinish() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.__color.toOriginal()); + } + } + _this2.__saturation_field.appendChild(valueField); + _this2.__selector.appendChild(_this2.__field_knob); + _this2.__selector.appendChild(_this2.__saturation_field); + _this2.__selector.appendChild(_this2.__hue_field); + _this2.__hue_field.appendChild(_this2.__hue_knob); + _this2.domElement.appendChild(_this2.__input); + _this2.domElement.appendChild(_this2.__selector); + _this2.updateDisplay(); + function setSV(e) { + if (e.type.indexOf('touch') === -1) { + e.preventDefault(); + } + var fieldRect = _this.__saturation_field.getBoundingClientRect(); + var _ref = e.touches && e.touches[0] || e, + clientX = _ref.clientX, + clientY = _ref.clientY; + var s = (clientX - fieldRect.left) / (fieldRect.right - fieldRect.left); + var v = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); + if (v > 1) { + v = 1; + } else if (v < 0) { + v = 0; + } + if (s > 1) { + s = 1; + } else if (s < 0) { + s = 0; + } + _this.__color.v = v; + _this.__color.s = s; + _this.setValue(_this.__color.toOriginal()); + return false; + } + function setH(e) { + if (e.type.indexOf('touch') === -1) { + e.preventDefault(); + } + var fieldRect = _this.__hue_field.getBoundingClientRect(); + var _ref2 = e.touches && e.touches[0] || e, + clientY = _ref2.clientY; + var h = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); + if (h > 1) { + h = 1; + } else if (h < 0) { + h = 0; + } + _this.__color.h = h * 360; + _this.setValue(_this.__color.toOriginal()); + return false; + } + return _this2; + } + createClass(ColorController, [{ + key: 'updateDisplay', + value: function updateDisplay() { + var i = interpret(this.getValue()); + if (i !== false) { + var mismatch = false; + Common.each(Color.COMPONENTS, function (component) { + if (!Common.isUndefined(i[component]) && !Common.isUndefined(this.__color.__state[component]) && i[component] !== this.__color.__state[component]) { + mismatch = true; + return {}; + } + }, this); + if (mismatch) { + Common.extend(this.__color.__state, i); + } + } + Common.extend(this.__temp.__state, this.__color.__state); + this.__temp.a = 1; + var flip = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0; + var _flip = 255 - flip; + Common.extend(this.__field_knob.style, { + marginLeft: 100 * this.__color.s - 7 + 'px', + marginTop: 100 * (1 - this.__color.v) - 7 + 'px', + backgroundColor: this.__temp.toHexString(), + border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')' + }); + this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'; + this.__temp.s = 1; + this.__temp.v = 1; + linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString()); + this.__input.value = this.__color.toString(); + Common.extend(this.__input.style, { + backgroundColor: this.__color.toHexString(), + color: 'rgb(' + flip + ',' + flip + ',' + flip + ')', + textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)' + }); + } + }]); + return ColorController; +}(Controller); +var vendors = ['-moz-', '-o-', '-webkit-', '-ms-', '']; +function linearGradient(elem, x, a, b) { + elem.style.background = ''; + Common.each(vendors, function (vendor) { + elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); '; + }); +} +function hueGradient(elem) { + elem.style.background = ''; + elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'; + elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; +} + +var css = { + load: function load(url, indoc) { + var doc = indoc || document; + var link = doc.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; + link.href = url; + doc.getElementsByTagName('head')[0].appendChild(link); + }, + inject: function inject(cssContent, indoc) { + var doc = indoc || document; + var injected = document.createElement('style'); + injected.type = 'text/css'; + injected.innerHTML = cssContent; + var head = doc.getElementsByTagName('head')[0]; + try { + head.appendChild(injected); + } catch (e) { + } + } +}; + +var saveDialogContents = "
\n\n Here's the new load parameter for your GUI's constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI's constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n
"; + +var ControllerFactory = function ControllerFactory(object, property) { + var initialValue = object[property]; + if (Common.isArray(arguments[2]) || Common.isObject(arguments[2])) { + return new OptionController(object, property, arguments[2]); + } + if (Common.isNumber(initialValue)) { + if (Common.isNumber(arguments[2]) && Common.isNumber(arguments[3])) { + if (Common.isNumber(arguments[4])) { + return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]); + } + return new NumberControllerSlider(object, property, arguments[2], arguments[3]); + } + if (Common.isNumber(arguments[4])) { + return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3], step: arguments[4] }); + } + return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] }); + } + if (Common.isString(initialValue)) { + return new StringController(object, property); + } + if (Common.isFunction(initialValue)) { + return new FunctionController(object, property, ''); + } + if (Common.isBoolean(initialValue)) { + return new BooleanController(object, property); + } + return null; +}; + +function requestAnimationFrame(callback) { + setTimeout(callback, 1000 / 60); +} +var requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame; + +var CenteredDiv = function () { + function CenteredDiv() { + classCallCheck(this, CenteredDiv); + this.backgroundElement = document.createElement('div'); + Common.extend(this.backgroundElement.style, { + backgroundColor: 'rgba(0,0,0,0.8)', + top: 0, + left: 0, + display: 'none', + zIndex: '1000', + opacity: 0, + WebkitTransition: 'opacity 0.2s linear', + transition: 'opacity 0.2s linear' + }); + dom.makeFullscreen(this.backgroundElement); + this.backgroundElement.style.position = 'fixed'; + this.domElement = document.createElement('div'); + Common.extend(this.domElement.style, { + position: 'fixed', + display: 'none', + zIndex: '1001', + opacity: 0, + WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear', + transition: 'transform 0.2s ease-out, opacity 0.2s linear' + }); + document.body.appendChild(this.backgroundElement); + document.body.appendChild(this.domElement); + var _this = this; + dom.bind(this.backgroundElement, 'click', function () { + _this.hide(); + }); + } + createClass(CenteredDiv, [{ + key: 'show', + value: function show() { + var _this = this; + this.backgroundElement.style.display = 'block'; + this.domElement.style.display = 'block'; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + this.layout(); + Common.defer(function () { + _this.backgroundElement.style.opacity = 1; + _this.domElement.style.opacity = 1; + _this.domElement.style.webkitTransform = 'scale(1)'; + }); + } + }, { + key: 'hide', + value: function hide() { + var _this = this; + var hide = function hide() { + _this.domElement.style.display = 'none'; + _this.backgroundElement.style.display = 'none'; + dom.unbind(_this.domElement, 'webkitTransitionEnd', hide); + dom.unbind(_this.domElement, 'transitionend', hide); + dom.unbind(_this.domElement, 'oTransitionEnd', hide); + }; + dom.bind(this.domElement, 'webkitTransitionEnd', hide); + dom.bind(this.domElement, 'transitionend', hide); + dom.bind(this.domElement, 'oTransitionEnd', hide); + this.backgroundElement.style.opacity = 0; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + } + }, { + key: 'layout', + value: function layout() { + this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px'; + this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px'; + } + }]); + return CenteredDiv; +}(); + +var styleSheet = ___$insertStyle(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"); + +css.inject(styleSheet); +var CSS_NAMESPACE = 'dg'; +var HIDE_KEY_CODE = 72; +var CLOSE_BUTTON_HEIGHT = 20; +var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; +var SUPPORTS_LOCAL_STORAGE = function () { + try { + return !!window.localStorage; + } catch (e) { + return false; + } +}(); +var SAVE_DIALOGUE = void 0; +var autoPlaceVirgin = true; +var autoPlaceContainer = void 0; +var hide = false; +var hideableGuis = []; +var GUI = function GUI(pars) { + var _this = this; + var params = pars || {}; + this.domElement = document.createElement('div'); + this.__ul = document.createElement('ul'); + this.domElement.appendChild(this.__ul); + dom.addClass(this.domElement, CSS_NAMESPACE); + this.__folders = {}; + this.__controllers = []; + this.__rememberedObjects = []; + this.__rememberedObjectIndecesToControllers = []; + this.__listening = []; + params = Common.defaults(params, { + closeOnTop: false, + autoPlace: true, + width: GUI.DEFAULT_WIDTH + }); + params = Common.defaults(params, { + resizable: params.autoPlace, + hideable: params.autoPlace + }); + if (!Common.isUndefined(params.load)) { + if (params.preset) { + params.load.preset = params.preset; + } + } else { + params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME }; + } + if (Common.isUndefined(params.parent) && params.hideable) { + hideableGuis.push(this); + } + params.resizable = Common.isUndefined(params.parent) && params.resizable; + if (params.autoPlace && Common.isUndefined(params.scrollable)) { + params.scrollable = true; + } + var useLocalStorage = SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true'; + var saveToLocalStorage = void 0; + var titleRow = void 0; + Object.defineProperties(this, + { + parent: { + get: function get$$1() { + return params.parent; + } + }, + scrollable: { + get: function get$$1() { + return params.scrollable; + } + }, + autoPlace: { + get: function get$$1() { + return params.autoPlace; + } + }, + closeOnTop: { + get: function get$$1() { + return params.closeOnTop; + } + }, + preset: { + get: function get$$1() { + if (_this.parent) { + return _this.getRoot().preset; + } + return params.load.preset; + }, + set: function set$$1(v) { + if (_this.parent) { + _this.getRoot().preset = v; + } else { + params.load.preset = v; + } + setPresetSelectIndex(this); + _this.revert(); + } + }, + width: { + get: function get$$1() { + return params.width; + }, + set: function set$$1(v) { + params.width = v; + setWidth(_this, v); + } + }, + name: { + get: function get$$1() { + return params.name; + }, + set: function set$$1(v) { + params.name = v; + if (titleRow) { + titleRow.innerHTML = params.name; + } + } + }, + closed: { + get: function get$$1() { + return params.closed; + }, + set: function set$$1(v) { + params.closed = v; + if (params.closed) { + dom.addClass(_this.__ul, GUI.CLASS_CLOSED); + } else { + dom.removeClass(_this.__ul, GUI.CLASS_CLOSED); + } + this.onResize(); + if (_this.__closeButton) { + _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED; + } + } + }, + load: { + get: function get$$1() { + return params.load; + } + }, + useLocalStorage: { + get: function get$$1() { + return useLocalStorage; + }, + set: function set$$1(bool) { + if (SUPPORTS_LOCAL_STORAGE) { + useLocalStorage = bool; + if (bool) { + dom.bind(window, 'unload', saveToLocalStorage); + } else { + dom.unbind(window, 'unload', saveToLocalStorage); + } + localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool); + } + } + } + }); + if (Common.isUndefined(params.parent)) { + this.closed = params.closed || false; + dom.addClass(this.domElement, GUI.CLASS_MAIN); + dom.makeSelectable(this.domElement, false); + if (SUPPORTS_LOCAL_STORAGE) { + if (useLocalStorage) { + _this.useLocalStorage = true; + var savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui')); + if (savedGui) { + params.load = JSON.parse(savedGui); + } + } + } + this.__closeButton = document.createElement('div'); + this.__closeButton.innerHTML = GUI.TEXT_CLOSED; + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON); + if (params.closeOnTop) { + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP); + this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]); + } else { + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM); + this.domElement.appendChild(this.__closeButton); + } + dom.bind(this.__closeButton, 'click', function () { + _this.closed = !_this.closed; + }); + } else { + if (params.closed === undefined) { + params.closed = true; + } + var titleRowName = document.createTextNode(params.name); + dom.addClass(titleRowName, 'controller-name'); + titleRow = addRow(_this, titleRowName); + var onClickTitle = function onClickTitle(e) { + e.preventDefault(); + _this.closed = !_this.closed; + return false; + }; + dom.addClass(this.__ul, GUI.CLASS_CLOSED); + dom.addClass(titleRow, 'title'); + dom.bind(titleRow, 'click', onClickTitle); + if (!params.closed) { + this.closed = false; + } + } + if (params.autoPlace) { + if (Common.isUndefined(params.parent)) { + if (autoPlaceVirgin) { + autoPlaceContainer = document.createElement('div'); + dom.addClass(autoPlaceContainer, CSS_NAMESPACE); + dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER); + document.body.appendChild(autoPlaceContainer); + autoPlaceVirgin = false; + } + autoPlaceContainer.appendChild(this.domElement); + dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE); + } + if (!this.parent) { + setWidth(_this, params.width); + } + } + this.__resizeHandler = function () { + _this.onResizeDebounced(); + }; + dom.bind(window, 'resize', this.__resizeHandler); + dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler); + dom.bind(this.__ul, 'transitionend', this.__resizeHandler); + dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler); + this.onResize(); + if (params.resizable) { + addResizeHandle(this); + } + saveToLocalStorage = function saveToLocalStorage() { + if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') { + localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject())); + } + }; + this.saveToLocalStorageIfPossible = saveToLocalStorage; + function resetWidth() { + var root = _this.getRoot(); + root.width += 1; + Common.defer(function () { + root.width -= 1; + }); + } + if (!params.parent) { + resetWidth(); + } +}; +GUI.toggleHide = function () { + hide = !hide; + Common.each(hideableGuis, function (gui) { + gui.domElement.style.display = hide ? 'none' : ''; + }); +}; +GUI.CLASS_AUTO_PLACE = 'a'; +GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac'; +GUI.CLASS_MAIN = 'main'; +GUI.CLASS_CONTROLLER_ROW = 'cr'; +GUI.CLASS_TOO_TALL = 'taller-than-window'; +GUI.CLASS_CLOSED = 'closed'; +GUI.CLASS_CLOSE_BUTTON = 'close-button'; +GUI.CLASS_CLOSE_TOP = 'close-top'; +GUI.CLASS_CLOSE_BOTTOM = 'close-bottom'; +GUI.CLASS_DRAG = 'drag'; +GUI.DEFAULT_WIDTH = 245; +GUI.TEXT_CLOSED = 'Close Controls'; +GUI.TEXT_OPEN = 'Open Controls'; +GUI._keydownHandler = function (e) { + if (document.activeElement.type !== 'text' && (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) { + GUI.toggleHide(); + } +}; +dom.bind(window, 'keydown', GUI._keydownHandler, false); +Common.extend(GUI.prototype, +{ + add: function add(object, property) { + return _add(this, object, property, { + factoryArgs: Array.prototype.slice.call(arguments, 2) + }); + }, + addColor: function addColor(object, property) { + return _add(this, object, property, { + color: true + }); + }, + remove: function remove(controller) { + this.__ul.removeChild(controller.__li); + this.__controllers.splice(this.__controllers.indexOf(controller), 1); + var _this = this; + Common.defer(function () { + _this.onResize(); + }); + }, + destroy: function destroy() { + if (this.parent) { + throw new Error('Only the root GUI should be removed with .destroy(). ' + 'For subfolders, use gui.removeFolder(folder) instead.'); + } + if (this.autoPlace) { + autoPlaceContainer.removeChild(this.domElement); + } + var _this = this; + Common.each(this.__folders, function (subfolder) { + _this.removeFolder(subfolder); + }); + dom.unbind(window, 'keydown', GUI._keydownHandler, false); + removeListeners(this); + }, + addFolder: function addFolder(name) { + if (this.__folders[name] !== undefined) { + throw new Error('You already have a folder in this GUI by the' + ' name "' + name + '"'); + } + var newGuiParams = { name: name, parent: this }; + newGuiParams.autoPlace = this.autoPlace; + if (this.load && + this.load.folders && + this.load.folders[name]) { + newGuiParams.closed = this.load.folders[name].closed; + newGuiParams.load = this.load.folders[name]; + } + var gui = new GUI(newGuiParams); + this.__folders[name] = gui; + var li = addRow(this, gui.domElement); + dom.addClass(li, 'folder'); + return gui; + }, + removeFolder: function removeFolder(folder) { + this.__ul.removeChild(folder.domElement.parentElement); + delete this.__folders[folder.name]; + if (this.load && + this.load.folders && + this.load.folders[folder.name]) { + delete this.load.folders[folder.name]; + } + removeListeners(folder); + var _this = this; + Common.each(folder.__folders, function (subfolder) { + folder.removeFolder(subfolder); + }); + Common.defer(function () { + _this.onResize(); + }); + }, + open: function open() { + this.closed = false; + }, + close: function close() { + this.closed = true; + }, + hide: function hide() { + this.domElement.style.display = 'none'; + }, + show: function show() { + this.domElement.style.display = ''; + }, + onResize: function onResize() { + var root = this.getRoot(); + if (root.scrollable) { + var top = dom.getOffset(root.__ul).top; + var h = 0; + Common.each(root.__ul.childNodes, function (node) { + if (!(root.autoPlace && node === root.__save_row)) { + h += dom.getHeight(node); + } + }); + if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { + dom.addClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px'; + } else { + dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = 'auto'; + } + } + if (root.__resize_handle) { + Common.defer(function () { + root.__resize_handle.style.height = root.__ul.offsetHeight + 'px'; + }); + } + if (root.__closeButton) { + root.__closeButton.style.width = root.width + 'px'; + } + }, + onResizeDebounced: Common.debounce(function () { + this.onResize(); + }, 50), + remember: function remember() { + if (Common.isUndefined(SAVE_DIALOGUE)) { + SAVE_DIALOGUE = new CenteredDiv(); + SAVE_DIALOGUE.domElement.innerHTML = saveDialogContents; + } + if (this.parent) { + throw new Error('You can only call remember on a top level GUI.'); + } + var _this = this; + Common.each(Array.prototype.slice.call(arguments), function (object) { + if (_this.__rememberedObjects.length === 0) { + addSaveMenu(_this); + } + if (_this.__rememberedObjects.indexOf(object) === -1) { + _this.__rememberedObjects.push(object); + } + }); + if (this.autoPlace) { + setWidth(this, this.width); + } + }, + getRoot: function getRoot() { + var gui = this; + while (gui.parent) { + gui = gui.parent; + } + return gui; + }, + getSaveObject: function getSaveObject() { + var toReturn = this.load; + toReturn.closed = this.closed; + if (this.__rememberedObjects.length > 0) { + toReturn.preset = this.preset; + if (!toReturn.remembered) { + toReturn.remembered = {}; + } + toReturn.remembered[this.preset] = getCurrentPreset(this); + } + toReturn.folders = {}; + Common.each(this.__folders, function (element, key) { + toReturn.folders[key] = element.getSaveObject(); + }); + return toReturn; + }, + save: function save() { + if (!this.load.remembered) { + this.load.remembered = {}; + } + this.load.remembered[this.preset] = getCurrentPreset(this); + markPresetModified(this, false); + this.saveToLocalStorageIfPossible(); + }, + saveAs: function saveAs(presetName) { + if (!this.load.remembered) { + this.load.remembered = {}; + this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true); + } + this.load.remembered[presetName] = getCurrentPreset(this); + this.preset = presetName; + addPresetOption(this, presetName, true); + this.saveToLocalStorageIfPossible(); + }, + revert: function revert(gui) { + Common.each(this.__controllers, function (controller) { + if (!this.getRoot().load.remembered) { + controller.setValue(controller.initialValue); + } else { + recallSavedValue(gui || this.getRoot(), controller); + } + if (controller.__onFinishChange) { + controller.__onFinishChange.call(controller, controller.getValue()); + } + }, this); + Common.each(this.__folders, function (folder) { + folder.revert(folder); + }); + if (!gui) { + markPresetModified(this.getRoot(), false); + } + }, + listen: function listen(controller) { + var init = this.__listening.length === 0; + this.__listening.push(controller); + if (init) { + updateDisplays(this.__listening); + } + }, + updateDisplay: function updateDisplay() { + Common.each(this.__controllers, function (controller) { + controller.updateDisplay(); + }); + Common.each(this.__folders, function (folder) { + folder.updateDisplay(); + }); + } +}); +function addRow(gui, newDom, liBefore) { + var li = document.createElement('li'); + if (newDom) { + li.appendChild(newDom); + } + if (liBefore) { + gui.__ul.insertBefore(li, liBefore); + } else { + gui.__ul.appendChild(li); + } + gui.onResize(); + return li; +} +function removeListeners(gui) { + dom.unbind(window, 'resize', gui.__resizeHandler); + if (gui.saveToLocalStorageIfPossible) { + dom.unbind(window, 'unload', gui.saveToLocalStorageIfPossible); + } +} +function markPresetModified(gui, modified) { + var opt = gui.__preset_select[gui.__preset_select.selectedIndex]; + if (modified) { + opt.innerHTML = opt.value + '*'; + } else { + opt.innerHTML = opt.value; + } +} +function augmentController(gui, li, controller) { + controller.__li = li; + controller.__gui = gui; + Common.extend(controller, { + options: function options(_options) { + if (arguments.length > 1) { + var nextSibling = controller.__li.nextElementSibling; + controller.remove(); + return _add(gui, controller.object, controller.property, { + before: nextSibling, + factoryArgs: [Common.toArray(arguments)] + }); + } + if (Common.isArray(_options) || Common.isObject(_options)) { + var _nextSibling = controller.__li.nextElementSibling; + controller.remove(); + return _add(gui, controller.object, controller.property, { + before: _nextSibling, + factoryArgs: [_options] + }); + } + }, + name: function name(_name) { + controller.__li.firstElementChild.firstElementChild.innerHTML = _name; + return controller; + }, + listen: function listen() { + controller.__gui.listen(controller); + return controller; + }, + remove: function remove() { + controller.__gui.remove(controller); + return controller; + } + }); + if (controller instanceof NumberControllerSlider) { + var box = new NumberControllerBox(controller.object, controller.property, { min: controller.__min, max: controller.__max, step: controller.__step }); + Common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step', 'min', 'max'], function (method) { + var pc = controller[method]; + var pb = box[method]; + controller[method] = box[method] = function () { + var args = Array.prototype.slice.call(arguments); + pb.apply(box, args); + return pc.apply(controller, args); + }; + }); + dom.addClass(li, 'has-slider'); + controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild); + } else if (controller instanceof NumberControllerBox) { + var r = function r(returned) { + if (Common.isNumber(controller.__min) && Common.isNumber(controller.__max)) { + var oldName = controller.__li.firstElementChild.firstElementChild.innerHTML; + var wasListening = controller.__gui.__listening.indexOf(controller) > -1; + controller.remove(); + var newController = _add(gui, controller.object, controller.property, { + before: controller.__li.nextElementSibling, + factoryArgs: [controller.__min, controller.__max, controller.__step] + }); + newController.name(oldName); + if (wasListening) newController.listen(); + return newController; + } + return returned; + }; + controller.min = Common.compose(r, controller.min); + controller.max = Common.compose(r, controller.max); + } else if (controller instanceof BooleanController) { + dom.bind(li, 'click', function () { + dom.fakeEvent(controller.__checkbox, 'click'); + }); + dom.bind(controller.__checkbox, 'click', function (e) { + e.stopPropagation(); + }); + } else if (controller instanceof FunctionController) { + dom.bind(li, 'click', function () { + dom.fakeEvent(controller.__button, 'click'); + }); + dom.bind(li, 'mouseover', function () { + dom.addClass(controller.__button, 'hover'); + }); + dom.bind(li, 'mouseout', function () { + dom.removeClass(controller.__button, 'hover'); + }); + } else if (controller instanceof ColorController) { + dom.addClass(li, 'color'); + controller.updateDisplay = Common.compose(function (val) { + li.style.borderLeftColor = controller.__color.toString(); + return val; + }, controller.updateDisplay); + controller.updateDisplay(); + } + controller.setValue = Common.compose(function (val) { + if (gui.getRoot().__preset_select && controller.isModified()) { + markPresetModified(gui.getRoot(), true); + } + return val; + }, controller.setValue); +} +function recallSavedValue(gui, controller) { + var root = gui.getRoot(); + var matchedIndex = root.__rememberedObjects.indexOf(controller.object); + if (matchedIndex !== -1) { + var controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex]; + if (controllerMap === undefined) { + controllerMap = {}; + root.__rememberedObjectIndecesToControllers[matchedIndex] = controllerMap; + } + controllerMap[controller.property] = controller; + if (root.load && root.load.remembered) { + var presetMap = root.load.remembered; + var preset = void 0; + if (presetMap[gui.preset]) { + preset = presetMap[gui.preset]; + } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) { + preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME]; + } else { + return; + } + if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) { + var value = preset[matchedIndex][controller.property]; + controller.initialValue = value; + controller.setValue(value); + } + } + } +} +function _add(gui, object, property, params) { + if (object[property] === undefined) { + throw new Error('Object "' + object + '" has no property "' + property + '"'); + } + var controller = void 0; + if (params.color) { + controller = new ColorController(object, property); + } else { + var factoryArgs = [object, property].concat(params.factoryArgs); + controller = ControllerFactory.apply(gui, factoryArgs); + } + if (params.before instanceof Controller) { + params.before = params.before.__li; + } + recallSavedValue(gui, controller); + dom.addClass(controller.domElement, 'c'); + var name = document.createElement('span'); + dom.addClass(name, 'property-name'); + name.innerHTML = controller.property; + var container = document.createElement('div'); + container.appendChild(name); + container.appendChild(controller.domElement); + var li = addRow(gui, container, params.before); + dom.addClass(li, GUI.CLASS_CONTROLLER_ROW); + if (controller instanceof ColorController) { + dom.addClass(li, 'color'); + } else { + dom.addClass(li, _typeof(controller.getValue())); + } + augmentController(gui, li, controller); + gui.__controllers.push(controller); + return controller; +} +function getLocalStorageHash(gui, key) { + return document.location.href + '.' + key; +} +function addPresetOption(gui, name, setSelected) { + var opt = document.createElement('option'); + opt.innerHTML = name; + opt.value = name; + gui.__preset_select.appendChild(opt); + if (setSelected) { + gui.__preset_select.selectedIndex = gui.__preset_select.length - 1; + } +} +function showHideExplain(gui, explain) { + explain.style.display = gui.useLocalStorage ? 'block' : 'none'; +} +function addSaveMenu(gui) { + var div = gui.__save_row = document.createElement('li'); + dom.addClass(gui.domElement, 'has-save'); + gui.__ul.insertBefore(div, gui.__ul.firstChild); + dom.addClass(div, 'save-row'); + var gears = document.createElement('span'); + gears.innerHTML = ' '; + dom.addClass(gears, 'button gears'); + var button = document.createElement('span'); + button.innerHTML = 'Save'; + dom.addClass(button, 'button'); + dom.addClass(button, 'save'); + var button2 = document.createElement('span'); + button2.innerHTML = 'New'; + dom.addClass(button2, 'button'); + dom.addClass(button2, 'save-as'); + var button3 = document.createElement('span'); + button3.innerHTML = 'Revert'; + dom.addClass(button3, 'button'); + dom.addClass(button3, 'revert'); + var select = gui.__preset_select = document.createElement('select'); + if (gui.load && gui.load.remembered) { + Common.each(gui.load.remembered, function (value, key) { + addPresetOption(gui, key, key === gui.preset); + }); + } else { + addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false); + } + dom.bind(select, 'change', function () { + for (var index = 0; index < gui.__preset_select.length; index++) { + gui.__preset_select[index].innerHTML = gui.__preset_select[index].value; + } + gui.preset = this.value; + }); + div.appendChild(select); + div.appendChild(gears); + div.appendChild(button); + div.appendChild(button2); + div.appendChild(button3); + if (SUPPORTS_LOCAL_STORAGE) { + var explain = document.getElementById('dg-local-explain'); + var localStorageCheckBox = document.getElementById('dg-local-storage'); + var saveLocally = document.getElementById('dg-save-locally'); + saveLocally.style.display = 'block'; + if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') { + localStorageCheckBox.setAttribute('checked', 'checked'); + } + showHideExplain(gui, explain); + dom.bind(localStorageCheckBox, 'change', function () { + gui.useLocalStorage = !gui.useLocalStorage; + showHideExplain(gui, explain); + }); + } + var newConstructorTextArea = document.getElementById('dg-new-constructor'); + dom.bind(newConstructorTextArea, 'keydown', function (e) { + if (e.metaKey && (e.which === 67 || e.keyCode === 67)) { + SAVE_DIALOGUE.hide(); + } + }); + dom.bind(gears, 'click', function () { + newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2); + SAVE_DIALOGUE.show(); + newConstructorTextArea.focus(); + newConstructorTextArea.select(); + }); + dom.bind(button, 'click', function () { + gui.save(); + }); + dom.bind(button2, 'click', function () { + var presetName = prompt('Enter a new preset name.'); + if (presetName) { + gui.saveAs(presetName); + } + }); + dom.bind(button3, 'click', function () { + gui.revert(); + }); +} +function addResizeHandle(gui) { + var pmouseX = void 0; + gui.__resize_handle = document.createElement('div'); + Common.extend(gui.__resize_handle.style, { + width: '6px', + marginLeft: '-3px', + height: '200px', + cursor: 'ew-resize', + position: 'absolute' + }); + function drag(e) { + e.preventDefault(); + gui.width += pmouseX - e.clientX; + gui.onResize(); + pmouseX = e.clientX; + return false; + } + function dragStop() { + dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.unbind(window, 'mousemove', drag); + dom.unbind(window, 'mouseup', dragStop); + } + function dragStart(e) { + e.preventDefault(); + pmouseX = e.clientX; + dom.addClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.bind(window, 'mousemove', drag); + dom.bind(window, 'mouseup', dragStop); + return false; + } + dom.bind(gui.__resize_handle, 'mousedown', dragStart); + dom.bind(gui.__closeButton, 'mousedown', dragStart); + gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild); +} +function setWidth(gui, w) { + gui.domElement.style.width = w + 'px'; + if (gui.__save_row && gui.autoPlace) { + gui.__save_row.style.width = w + 'px'; + } + if (gui.__closeButton) { + gui.__closeButton.style.width = w + 'px'; + } +} +function getCurrentPreset(gui, useInitialValues) { + var toReturn = {}; + Common.each(gui.__rememberedObjects, function (val, index) { + var savedValues = {}; + var controllerMap = gui.__rememberedObjectIndecesToControllers[index]; + Common.each(controllerMap, function (controller, property) { + savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue(); + }); + toReturn[index] = savedValues; + }); + return toReturn; +} +function setPresetSelectIndex(gui) { + for (var index = 0; index < gui.__preset_select.length; index++) { + if (gui.__preset_select[index].value === gui.preset) { + gui.__preset_select.selectedIndex = index; + } + } +} +function updateDisplays(controllerArray) { + if (controllerArray.length !== 0) { + requestAnimationFrame$1.call(window, function () { + updateDisplays(controllerArray); + }); + } + Common.each(controllerArray, function (c) { + c.updateDisplay(); + }); +} +var GUI$1 = GUI; + +/** Shows an error dialog if getting an adapter wasn't successful. */ +function quitIfAdapterNotAvailable(adapter) { + if (!('gpu' in navigator)) { + fail('navigator.gpu is not defined - WebGPU not available in this browser'); + } + if (!adapter) { + fail("requestAdapter returned null - this sample can't run on this system"); + } +} +/** + * Shows an error dialog if getting a adapter or device wasn't successful, + * or if/when the device is lost or has an uncaptured error. + */ +function quitIfWebGPUNotAvailable(adapter, device) { + if (!device) { + quitIfAdapterNotAvailable(adapter); + fail('Unable to get a device for an unknown reason'); + return; + } + device.lost.then((reason) => { + fail(`Device lost ("${reason.reason}"):\n${reason.message}`); + }); + device.onuncapturederror = (ev) => { + fail(`Uncaptured error:\n${ev.error.message}`); + }; +} +/** Fail by showing a console error, and dialog box if possible. */ +const fail = (() => { + function createErrorOutput() { + if (typeof document === 'undefined') { + // Not implemented in workers. + return { + show(msg) { + console.error(msg); + }, + }; + } + const dialogBox = document.createElement('dialog'); + dialogBox.close(); + document.body.append(dialogBox); + const dialogText = document.createElement('pre'); + dialogText.style.whiteSpace = 'pre-wrap'; + dialogBox.append(dialogText); + const closeBtn = document.createElement('button'); + closeBtn.textContent = 'OK'; + closeBtn.onclick = () => dialogBox.close(); + dialogBox.append(closeBtn); + return { + show(msg) { + // Don't overwrite the dialog message while it's still open + // (show the first error, not the most recent error). + if (!dialogBox.open) { + dialogText.textContent = msg; + dialogBox.showModal(); + } + }, + }; + } + let output; + return (message) => { + if (!output) + output = createErrorOutput(); + output.show(message); + throw new Error(message); + }; +})(); + +var texturedQuadWGSL = `struct OurVertexShaderOutput { + @builtin(position) position: vec4f, + @location(0) texcoord: vec2f, +}; + +struct Uniforms { + matrix: mat4x4f, +}; + +@group(0) @binding(2) var uni: Uniforms; + +@vertex fn vs( + @builtin(vertex_index) vertexIndex : u32 +) -> OurVertexShaderOutput { + let pos = array( + + vec2f( 0.0, 0.0), // center + vec2f( 1.0, 0.0), // right, center + vec2f( 0.0, 1.0), // center, top + + // 2st triangle + vec2f( 0.0, 1.0), // center, top + vec2f( 1.0, 0.0), // right, center + vec2f( 1.0, 1.0), // right, top + ); + + var vsOutput: OurVertexShaderOutput; + let xy = pos[vertexIndex]; + vsOutput.position = uni.matrix * vec4f(xy, 0.0, 1.0); + vsOutput.texcoord = xy; + return vsOutput; +} + +@group(0) @binding(0) var ourSampler: sampler; +@group(0) @binding(1) var ourTexture: texture_2d; + +@fragment fn fs(fsInput: OurVertexShaderOutput) -> @location(0) vec4f { + return textureSample(ourTexture, ourSampler, fsInput.texcoord); +}`; + +const adapter = await navigator.gpu?.requestAdapter(); +const device = await adapter?.requestDevice(); +quitIfWebGPUNotAvailable(adapter, device); +// creates a CSS hsl string from 3 normalized numbers (0 to 1) +const hsl = (hue, saturation, lightness) => `hsl(${(hue * 360) | 0}, ${saturation * 100}%, ${(lightness * 100) | 0}%)`; +// creates a CSS hsla string from 4 normalized numbers (0 to 1) +const hsla = (hue, saturation, lightness, alpha) => +// prettier-ignore +`hsla(${(hue * 360) | 0}, ${saturation * 100}%, ${(lightness * 100) | 0}%, ${alpha})`; +// Generates a canvas with 3 circles of different colors with blurred edges. +function createSourceImage(size) { + const canvas = document.createElement('canvas'); + canvas.width = size; + canvas.height = size; + const ctx = canvas.getContext('2d'); + ctx.translate(size / 2, size / 2); + ctx.globalCompositeOperation = 'screen'; + const numCircles = 3; + for (let i = 0; i < numCircles; ++i) { + ctx.rotate((Math.PI * 2) / numCircles); + ctx.save(); + ctx.translate(size / 6, 0); + ctx.beginPath(); + const radius = size / 3; + ctx.arc(0, 0, radius, 0, Math.PI * 2); + const gradient = ctx.createRadialGradient(0, 0, radius / 2, 0, 0, radius); + const h = i / numCircles; + gradient.addColorStop(0.5, hsla(h, 1, 0.5, 1)); + gradient.addColorStop(1, hsla(h, 1, 0.5, 0)); + ctx.fillStyle = gradient; + ctx.fill(); + ctx.restore(); + } + return canvas; +} +// Generates a canvas with alternating colored and transparent stripes +function createDestinationImage(size) { + const canvas = document.createElement('canvas'); + canvas.width = size; + canvas.height = size; + const ctx = canvas.getContext('2d'); + const gradient = ctx.createLinearGradient(0, 0, size, size); + for (let i = 0; i <= 6; ++i) { + gradient.addColorStop(i / 6, hsl(i / -6, 1, 0.5)); + } + ctx.fillStyle = gradient; + ctx.fillRect(0, 0, size, size); + ctx.fillStyle = 'rgba(0, 0, 0, 255)'; + ctx.globalCompositeOperation = 'destination-out'; + ctx.rotate(Math.PI / -4); + for (let i = 0; i < size * 2; i += 32) { + ctx.fillRect(-size, i, size * 2, 16); + } + return canvas; +} +// make 2 canvas elements, 300x300 with images in them. +// We'll copy these to textures. +const size = 300; +const srcCanvas = createSourceImage(size); +const dstCanvas = createDestinationImage(size); +// Get a WebGPU context from the canvas and configure it +const canvas = document.querySelector('canvas'); +const context = canvas.getContext('webgpu'); +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); +const module = device.createShaderModule({ + label: 'our hardcoded textured quad shaders', + code: texturedQuadWGSL, +}); +function createTextureFromSource(device, source, options = {}) { + const { flipY, premultipliedAlpha } = options; + const texture = device.createTexture({ + format: 'rgba8unorm', + size: [source.width, source.height], + usage: GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture({ source, flipY }, { texture, premultipliedAlpha }, { width: source.width, height: source.height }); + return texture; +} +const bindGroupLayout = device.createBindGroupLayout({ + entries: [ + { binding: 0, visibility: GPUShaderStage.FRAGMENT, sampler: {} }, + { binding: 1, visibility: GPUShaderStage.FRAGMENT, texture: {} }, + { binding: 2, visibility: GPUShaderStage.VERTEX, buffer: {} }, + ], +}); +const pipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [bindGroupLayout], +}); +// create 2 textures with unpremultiplied alpha +const srcTextureUnpremultipliedAlpha = createTextureFromSource(device, srcCanvas); +const dstTextureUnpremultipliedAlpha = createTextureFromSource(device, dstCanvas); +// create 2 textures with premultiplied alpha +const srcTexturePremultipliedAlpha = createTextureFromSource(device, srcCanvas, { premultipliedAlpha: true }); +const dstTexturePremultipliedAlpha = createTextureFromSource(device, dstCanvas, { premultipliedAlpha: true }); +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', + mipmapFilter: 'linear', +}); +function makeUniformBufferAndValues(device) { + // offsets to the various uniform values in float32 indices + const kMatrixOffset = 0; + // create a buffer for the uniform values + const uniformBufferSize = 16 * 4; // matrix is 16 32bit floats (4bytes each) + const buffer = device.createBuffer({ + label: 'uniforms for quad', + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + // create a typedarray to hold the values for the uniforms in JavaScript + const values = new Float32Array(uniformBufferSize / 4); + const matrix = values.subarray(kMatrixOffset, 16); + return { buffer, values, matrix }; +} +const srcUniform = makeUniformBufferAndValues(device); +const dstUniform = makeUniformBufferAndValues(device); +const srcBindGroupUnpremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: srcTextureUnpremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: srcUniform.buffer } }, + ], +}); +const dstBindGroupUnpremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: dstTextureUnpremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: dstUniform.buffer } }, + ], +}); +const srcBindGroupPremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: srcTexturePremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: srcUniform.buffer } }, + ], +}); +const dstBindGroupPremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: dstTexturePremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: dstUniform.buffer } }, + ], +}); +const textureSets = [ + { + srcTexture: srcTexturePremultipliedAlpha, + dstTexture: dstTexturePremultipliedAlpha, + srcBindGroup: srcBindGroupPremultipliedAlpha, + dstBindGroup: dstBindGroupPremultipliedAlpha, + }, + { + srcTexture: srcTextureUnpremultipliedAlpha, + dstTexture: dstTextureUnpremultipliedAlpha, + srcBindGroup: srcBindGroupUnpremultipliedAlpha, + dstBindGroup: dstBindGroupUnpremultipliedAlpha, + }, +]; +const clearValue = [0, 0, 0, 0]; +const renderPassDescriptor = { + label: 'our basic canvas renderPass', + colorAttachments: [ + { + view: undefined, // <- to be filled out when we render + clearValue, + loadOp: 'clear', + storeOp: 'store', + }, + ], +}; +const operations = ['add', 'subtract', 'reverse-subtract', 'min', 'max']; +const factors = [ + 'zero', + 'one', + 'src', + 'one-minus-src', + 'src-alpha', + 'one-minus-src-alpha', + 'dst', + 'one-minus-dst', + 'dst-alpha', + 'one-minus-dst-alpha', + 'src-alpha-saturated', + 'constant', + 'one-minus-constant', +]; +const presets = { + 'default (copy)': { + color: { + operation: 'add', + srcFactor: 'one', + dstFactor: 'zero', + }, + }, + 'premultiplied blend (source-over)': { + color: { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'un-premultiplied blend': { + color: { + operation: 'add', + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'destination-over': { + color: { + operation: 'add', + srcFactor: 'one-minus-dst-alpha', + dstFactor: 'one', + }, + }, + 'source-in': { + color: { + operation: 'add', + srcFactor: 'dst-alpha', + dstFactor: 'zero', + }, + }, + 'destination-in': { + color: { + operation: 'add', + srcFactor: 'zero', + dstFactor: 'src-alpha', + }, + }, + 'source-out': { + color: { + operation: 'add', + srcFactor: 'one-minus-dst-alpha', + dstFactor: 'zero', + }, + }, + 'destination-out': { + color: { + operation: 'add', + srcFactor: 'zero', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'source-atop': { + color: { + operation: 'add', + srcFactor: 'dst-alpha', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'destination-atop': { + color: { + operation: 'add', + srcFactor: 'one-minus-dst-alpha', + dstFactor: 'src-alpha', + }, + }, + 'additive (lighten)': { + color: { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one', + }, + }, +}; +function keysOf(obj) { + return Object.keys(obj); +} +const color = { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one-minus-src', +}; +const alpha = { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one-minus-src', +}; +const constant = { + color: [1, 0.5, 0.25], + alpha: 1, +}; +const clear = { + color: [0, 0, 0], + alpha: 0, + premultiply: true, +}; +const settings = { + alphaMode: 'premultiplied', + textureSet: 'premultiplied alpha', + preset: 'premultiplied blend (source-over)', +}; +// Translates to/from a normalized color value and an 8bit unsigned color value. +// This is because dat.gui only edits 8bit unsigned color values but we need normalized color values. +class GUIColorHelper { + normalizedColor; + constructor(normalizedColor) { + this.normalizedColor = normalizedColor; + } + get value() { + return this.normalizedColor.map((v) => Math.round(v * 255)); + } + set value(rgb255Color) { + this.normalizedColor.forEach((_, i) => (this.normalizedColor[i] = rgb255Color[i] / 255)); + } +} +function applyPreset() { + const preset = presets[settings.preset]; + Object.assign(color, preset.color); + Object.assign(alpha, preset.alpha || preset.color); +} +const gui = new GUI$1(); +gui + .add(settings, 'alphaMode', ['opaque', 'premultiplied']) + .name('canvas alphaMode') + .onChange(render); +gui + .add(settings, 'textureSet', [ + 'premultiplied alpha', + 'un-premultiplied alpha', +]) + .name('texture data') + .onChange(render); +gui.add(settings, 'preset', [...Object.keys(presets)]).onChange(() => { + applyPreset(); + render(); +}); +const colorFolder = gui.addFolder('color'); +colorFolder.open(); +colorFolder.add(color, 'operation', operations).onChange(render); +colorFolder.add(color, 'srcFactor', factors).onChange(render); +colorFolder.add(color, 'dstFactor', factors).onChange(render); +const alphaFolder = gui.addFolder('alpha'); +alphaFolder.open(); +alphaFolder.add(alpha, 'operation', operations).onChange(render); +alphaFolder.add(alpha, 'srcFactor', factors).onChange(render); +alphaFolder.add(alpha, 'dstFactor', factors).onChange(render); +const constantFolder = gui.addFolder('constant'); +constantFolder.open(); +constantFolder + .addColor(new GUIColorHelper(constant.color), 'value') + .name('color') + .onChange(render); +constantFolder.add(constant, 'alpha', 0, 1).onChange(render); +const clearFolder = gui.addFolder('clear color'); +clearFolder.open(); +clearFolder.add(clear, 'premultiply').onChange(render); +clearFolder.add(clear, 'alpha', 0, 1).onChange(render); +clearFolder.addColor(new GUIColorHelper(clear.color), 'value').onChange(render); +const dstPipeline = device.createRenderPipeline({ + label: 'hardcoded textured quad pipeline', + layout: pipelineLayout, + vertex: { + module, + }, + fragment: { + module, + targets: [{ format: presentationFormat }], + }, +}); +function makeBlendComponentValid(blend) { + const { operation } = blend; + if (operation === 'min' || operation === 'max') { + blend.srcFactor = 'one'; + blend.dstFactor = 'one'; + } +} +function render() { + makeBlendComponentValid(color); + makeBlendComponentValid(alpha); + gui.updateDisplay(); + const srcPipeline = device.createRenderPipeline({ + label: 'hardcoded textured quad pipeline', + layout: pipelineLayout, + vertex: { + module, + }, + fragment: { + module, + targets: [ + { + format: presentationFormat, + blend: { + color, + alpha, + }, + }, + ], + }, + }); + const { srcTexture, dstTexture, srcBindGroup, dstBindGroup } = textureSets[settings.textureSet === 'premultiplied alpha' ? 0 : 1]; + context.configure({ + device, + format: presentationFormat, + alphaMode: settings.alphaMode, + }); + const canvasTexture = context.getCurrentTexture(); + // Get the current texture from the canvas context and + // set it as the texture to render to. + renderPassDescriptor.colorAttachments[0].view = canvasTexture.createView(); + // Apply the clearValue, pre-multiplying or not it based on the settings. + { + const { alpha, color, premultiply } = clear; + const mult = premultiply ? alpha : 1; + clearValue[0] = color[0] * mult; + clearValue[1] = color[1] * mult; + clearValue[2] = color[2] * mult; + clearValue[3] = alpha; + } + function updateUniforms(uniforms, canvasTexture, texture) { + const projectionMatrix = mat4.ortho(0, canvasTexture.width / devicePixelRatio, canvasTexture.height / devicePixelRatio, 0, -1, 1); + mat4.scale(projectionMatrix, [texture.width, texture.height, 1], uniforms.matrix); + // copy the values from JavaScript to the GPU + device.queue.writeBuffer(uniforms.buffer, 0, uniforms.values); + } + updateUniforms(srcUniform, canvasTexture, srcTexture); + updateUniforms(dstUniform, canvasTexture, dstTexture); + const encoder = device.createCommandEncoder({ + label: 'render quad encoder', + }); + const pass = encoder.beginRenderPass(renderPassDescriptor); + // draw destination texture without blending + pass.setPipeline(dstPipeline); + pass.setBindGroup(0, dstBindGroup); + pass.draw(6); + // draw source texture with blending + pass.setPipeline(srcPipeline); + pass.setBindGroup(0, srcBindGroup); + pass.setBlendConstant([...constant.color, constant.alpha]); + pass.draw(6); + pass.end(); + const commandBuffer = encoder.finish(); + device.queue.submit([commandBuffer]); +} +applyPreset(); +render(); + +export { keysOf }; +//# sourceMappingURL=main.js.map diff --git a/sample/blending/main.js.map b/sample/blending/main.js.map new file mode 100644 index 00000000..833a9375 --- /dev/null +++ b/sample/blending/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sources":["../../../node_modules/wgpu-matrix/dist/3.x/wgpu-matrix.module.js","../../../node_modules/dat.gui/build/dat.gui.module.js","../../../../../sample/util.ts","../../../../../sample/blending/main.ts"],"sourcesContent":["/* wgpu-matrix@3.3.0, license MIT */\nfunction wrapConstructor(OriginalConstructor, modifier) {\n return class extends OriginalConstructor {\n constructor(...args) {\n super(...args);\n modifier(this);\n }\n }; // Type assertion is necessary here\n}\nconst ZeroArray = wrapConstructor((Array), a => a.fill(0));\n\n/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nlet EPSILON = 0.000001;\n/**\n * Set the value for EPSILON for various checks\n * @param v - Value to use for EPSILON.\n * @returns previous value of EPSILON;\n */\nfunction setEpsilon(v) {\n const old = EPSILON;\n EPSILON = v;\n return old;\n}\n/**\n * Convert degrees to radians\n * @param degrees - Angle in degrees\n * @returns angle converted to radians\n */\nfunction degToRad(degrees) {\n return degrees * Math.PI / 180;\n}\n/**\n * Convert radians to degrees\n * @param radians - Angle in radians\n * @returns angle converted to degrees\n */\nfunction radToDeg(radians) {\n return radians * 180 / Math.PI;\n}\n/**\n * Lerps between a and b via t\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @returns a + (b - a) * t\n */\nfunction lerp(a, b, t) {\n return a + (b - a) * t;\n}\n/**\n * Compute the opposite of lerp. Given a and b and a value between\n * a and b returns a value between 0 and 1. 0 if a, 1 if b.\n * Note: no clamping is done.\n * @param a - start value\n * @param b - end value\n * @param v - value between a and b\n * @returns (v - a) / (b - a)\n */\nfunction inverseLerp(a, b, v) {\n const d = b - a;\n return (Math.abs(b - a) < EPSILON)\n ? a\n : (v - a) / d;\n}\n/**\n * Compute the euclidean modulo\n *\n * ```\n * // table for n / 3\n * -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 <- n\n * ------------------------------------\n * -2 -1 -0 -2 -1 0, 1, 2, 0, 1, 2 <- n % 3\n * 1 2 0 1 2 0, 1, 2, 0, 1, 2 <- euclideanModule(n, 3)\n * ```\n *\n * @param n - dividend\n * @param m - divisor\n * @returns the euclidean modulo of n / m\n */\nfunction euclideanModulo(n, m) {\n return ((n % m) + m) % m;\n}\n\nvar utils = {\n __proto__: null,\n get EPSILON () { return EPSILON; },\n degToRad: degToRad,\n euclideanModulo: euclideanModulo,\n inverseLerp: inverseLerp,\n lerp: lerp,\n radToDeg: radToDeg,\n setEpsilon: setEpsilon\n};\n\n/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n * Generates am typed API for Vec3\n */\nfunction getAPIImpl$5(Ctor) {\n /**\n * Creates a Vec2; may be called with x, y, z to set initial values.\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Vec2's specified type\n * it would be faster to use\n *\n * ```\n * const v = vec2.clone(someJSArray);\n * ```\n *\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\n function create(x = 0, y = 0) {\n const newDst = new Ctor(2);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n }\n }\n return newDst;\n }\n /**\n * Creates a Vec2; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @returns the created vector\n */\n const fromValues = create;\n /**\n * Sets the values of a Vec2\n * Also see {@link vec2.create} and {@link vec2.copy}\n *\n * @param x first value\n * @param y second value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\n function set(x, y, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = x;\n newDst[1] = y;\n return newDst;\n }\n /**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\n function ceil(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n return newDst;\n }\n /**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\n function floor(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n return newDst;\n }\n /**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\n function round(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n return newDst;\n }\n /**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\n function clamp(v, min = 0, max = 1, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n return newDst;\n }\n /**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\n function add(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n return newDst;\n }\n /**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\n function addScaled(a, b, scale, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n return newDst;\n }\n /**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\n function angle(a, b) {\n const ax = a[0];\n const ay = a[1];\n const bx = b[0];\n const by = b[1];\n const mag1 = Math.sqrt(ax * ax + ay * ay);\n const mag2 = Math.sqrt(bx * bx + by * by);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n }\n /**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\n function subtract(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n return newDst;\n }\n /**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\n const sub = subtract;\n /**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\n function equalsApproximately(a, b) {\n return Math.abs(a[0] - b[0]) < EPSILON &&\n Math.abs(a[1] - b[1]) < EPSILON;\n }\n /**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\n function equals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n }\n /**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\n function lerp(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n return newDst;\n }\n /**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\n function lerpV(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n return newDst;\n }\n /**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\n function max(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n return newDst;\n }\n /**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\n function min(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n return newDst;\n }\n /**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n function mulScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n return newDst;\n }\n /**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n const scale = mulScalar;\n /**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n function divScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n return newDst;\n }\n /**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\n function inverse(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n return newDst;\n }\n /**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\n const invert = inverse;\n /**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\n function cross(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n const z = a[0] * b[1] - a[1] * b[0];\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = z;\n return newDst;\n }\n /**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\n function dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n }\n /**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\n function length(v) {\n const v0 = v[0];\n const v1 = v[1];\n return Math.sqrt(v0 * v0 + v1 * v1);\n }\n /**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\n const len = length;\n /**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\n function lengthSq(v) {\n const v0 = v[0];\n const v1 = v[1];\n return v0 * v0 + v1 * v1;\n }\n /**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\n const lenSq = lengthSq;\n /**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\n function distance(a, b) {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return Math.sqrt(dx * dx + dy * dy);\n }\n /**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\n const dist = distance;\n /**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\n function distanceSq(a, b) {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n return dx * dx + dy * dy;\n }\n /**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\n const distSq = distanceSq;\n /**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\n function normalize(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n const v0 = v[0];\n const v1 = v[1];\n const len = Math.sqrt(v0 * v0 + v1 * v1);\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n }\n else {\n newDst[0] = 0;\n newDst[1] = 0;\n }\n return newDst;\n }\n /**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\n function negate(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n return newDst;\n }\n /**\n * Copies a vector. (same as {@link vec2.clone})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\n function copy(v, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = v[0];\n newDst[1] = v[1];\n return newDst;\n }\n /**\n * Clones a vector. (same as {@link vec2.copy})\n * Also see {@link vec2.create} and {@link vec2.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\n const clone = copy;\n /**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\n function multiply(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n return newDst;\n }\n /**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\n const mul = multiply;\n /**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\n function divide(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n return newDst;\n }\n /**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\n const div = divide;\n /**\n * Creates a random unit vector * scale\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\n function random(scale = 1, dst) {\n const newDst = (dst ?? new Ctor(2));\n const angle = Math.random() * 2 * Math.PI;\n newDst[0] = Math.cos(angle) * scale;\n newDst[1] = Math.sin(angle) * scale;\n return newDst;\n }\n /**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\n function zero(dst) {\n const newDst = (dst ?? new Ctor(2));\n newDst[0] = 0;\n newDst[1] = 0;\n return newDst;\n }\n /**\n * transform Vec2 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\n function transformMat4(v, m, dst) {\n const newDst = (dst ?? new Ctor(2));\n const x = v[0];\n const y = v[1];\n newDst[0] = x * m[0] + y * m[4] + m[12];\n newDst[1] = x * m[1] + y * m[5] + m[13];\n return newDst;\n }\n /**\n * Transforms vec4 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional Vec2 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\n function transformMat3(v, m, dst) {\n const newDst = (dst ?? new Ctor(2));\n const x = v[0];\n const y = v[1];\n newDst[0] = m[0] * x + m[4] * y + m[8];\n newDst[1] = m[1] * x + m[5] * y + m[9];\n return newDst;\n }\n /**\n * Rotate a 2D vector\n *\n * @param a The vec2 point to rotate\n * @param b The origin of the rotation\n * @param rad The angle of rotation in radians\n * @returns the rotated vector\n */\n function rotate(a, b, rad, dst) {\n const newDst = (dst ?? new Ctor(2));\n // Translate point to the origin\n const p0 = a[0] - b[0];\n const p1 = a[1] - b[1];\n const sinC = Math.sin(rad);\n const cosC = Math.cos(rad);\n //perform rotation and translate to correct position\n newDst[0] = p0 * cosC - p1 * sinC + b[0];\n newDst[1] = p0 * sinC + p1 * cosC + b[1];\n return newDst;\n }\n /**\n * Treat a 2D vector as a direction and set it's length\n *\n * @param a The vec2 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\n function setLength(a, len, dst) {\n const newDst = (dst ?? new Ctor(2));\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n }\n /**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec2 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\n function truncate(a, maxLen, dst) {\n const newDst = (dst ?? new Ctor(2));\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n return copy(a, newDst);\n }\n /**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\n function midpoint(a, b, dst) {\n const newDst = (dst ?? new Ctor(2));\n return lerp(a, b, 0.5, newDst);\n }\n return {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat3,\n rotate,\n setLength,\n truncate,\n midpoint,\n };\n}\nconst cache$5 = new Map();\nfunction getAPI$5(Ctor) {\n let api = cache$5.get(Ctor);\n if (!api) {\n api = getAPIImpl$5(Ctor);\n cache$5.set(Ctor, api);\n }\n return api;\n}\n\n/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n * Generates am typed API for Vec3\n * */\nfunction getAPIImpl$4(Ctor) {\n /**\n * Creates a vec3; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\n function create(x, y, z) {\n const newDst = new Ctor(3);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n }\n }\n }\n return newDst;\n }\n /**\n * Creates a vec3; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @returns the created vector\n */\n const fromValues = create;\n /**\n * Sets the values of a Vec3\n * Also see {@link vec3.create} and {@link vec3.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\n function set(x, y, z, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n return newDst;\n }\n /**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\n function ceil(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n return newDst;\n }\n /**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\n function floor(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n return newDst;\n }\n /**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\n function round(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n return newDst;\n }\n /**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\n function clamp(v, min = 0, max = 1, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n return newDst;\n }\n /**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\n function add(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n return newDst;\n }\n /**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\n function addScaled(a, b, scale, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n return newDst;\n }\n /**\n * Returns the angle in radians between two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns The angle in radians between the 2 vectors.\n */\n function angle(a, b) {\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);\n const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);\n const mag = mag1 * mag2;\n const cosine = mag && dot(a, b) / mag;\n return Math.acos(cosine);\n }\n /**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\n function subtract(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n return newDst;\n }\n /**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\n const sub = subtract;\n /**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\n function equalsApproximately(a, b) {\n return Math.abs(a[0] - b[0]) < EPSILON &&\n Math.abs(a[1] - b[1]) < EPSILON &&\n Math.abs(a[2] - b[2]) < EPSILON;\n }\n /**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\n function equals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n }\n /**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\n function lerp(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n return newDst;\n }\n /**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\n function lerpV(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n return newDst;\n }\n /**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\n function max(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n return newDst;\n }\n /**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\n function min(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n return newDst;\n }\n /**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n function mulScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n return newDst;\n }\n /**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n const scale = mulScalar;\n /**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n function divScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n return newDst;\n }\n /**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\n function inverse(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n return newDst;\n }\n /**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\n const invert = inverse;\n /**\n * Computes the cross product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of a cross b.\n */\n function cross(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n const t1 = a[2] * b[0] - a[0] * b[2];\n const t2 = a[0] * b[1] - a[1] * b[0];\n newDst[0] = a[1] * b[2] - a[2] * b[1];\n newDst[1] = t1;\n newDst[2] = t2;\n return newDst;\n }\n /**\n * Computes the dot product of two vectors; assumes both vectors have\n * three entries.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\n function dot(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);\n }\n /**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\n function length(v) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n }\n /**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\n const len = length;\n /**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\n function lengthSq(v) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n return v0 * v0 + v1 * v1 + v2 * v2;\n }\n /**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\n const lenSq = lengthSq;\n /**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\n function distance(a, b) {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n }\n /**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\n const dist = distance;\n /**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\n function distanceSq(a, b) {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n return dx * dx + dy * dy + dz * dz;\n }\n /**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\n const distSq = distanceSq;\n /**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\n function normalize(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2);\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n }\n else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n return newDst;\n }\n /**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\n function negate(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n return newDst;\n }\n /**\n * Copies a vector. (same as {@link vec3.clone})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\n function copy(v, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n return newDst;\n }\n /**\n * Clones a vector. (same as {@link vec3.copy})\n * Also see {@link vec3.create} and {@link vec3.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\n const clone = copy;\n /**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\n function multiply(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n return newDst;\n }\n /**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\n const mul = multiply;\n /**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\n function divide(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n return newDst;\n }\n /**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\n const div = divide;\n /**\n * Creates a random vector\n * @param scale - Default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The random vector.\n */\n function random(scale = 1, dst) {\n const newDst = (dst ?? new Ctor(3));\n const angle = Math.random() * 2 * Math.PI;\n const z = Math.random() * 2 - 1;\n const zScale = Math.sqrt(1 - z * z) * scale;\n newDst[0] = Math.cos(angle) * zScale;\n newDst[1] = Math.sin(angle) * zScale;\n newDst[2] = z * scale;\n return newDst;\n }\n /**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\n function zero(dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n return newDst;\n }\n /**\n * transform vec3 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\n function transformMat4(v, m, dst) {\n const newDst = (dst ?? new Ctor(3));\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = (m[3] * x + m[7] * y + m[11] * z + m[15]) || 1;\n newDst[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n newDst[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n newDst[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return newDst;\n }\n /**\n * Transform vec3 by upper 3x3 matrix inside 4x4 matrix.\n * @param v - The direction.\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns The transformed vector.\n */\n function transformMat4Upper3x3(v, m, dst) {\n const newDst = (dst ?? new Ctor(3));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n newDst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2];\n return newDst;\n }\n /**\n * Transforms vec3 by 3x3 matrix\n *\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\n function transformMat3(v, m, dst) {\n const newDst = (dst ?? new Ctor(3));\n const x = v[0];\n const y = v[1];\n const z = v[2];\n newDst[0] = x * m[0] + y * m[4] + z * m[8];\n newDst[1] = x * m[1] + y * m[5] + z * m[9];\n newDst[2] = x * m[2] + y * m[6] + z * m[10];\n return newDst;\n }\n /**\n * Transforms vec3 by Quaternion\n * @param v - the vector to transform\n * @param q - the quaternion to transform by\n * @param dst - optional vec3 to store result. If not passed a new one is created.\n * @returns the transformed\n */\n function transformQuat(v, q, dst) {\n const newDst = (dst ?? new Ctor(3));\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const w2 = q[3] * 2;\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const uvX = qy * z - qz * y;\n const uvY = qz * x - qx * z;\n const uvZ = qx * y - qy * x;\n newDst[0] = x + uvX * w2 + (qy * uvZ - qz * uvY) * 2;\n newDst[1] = y + uvY * w2 + (qz * uvX - qx * uvZ) * 2;\n newDst[2] = z + uvZ * w2 + (qx * uvY - qy * uvX) * 2;\n return newDst;\n }\n /**\n * Returns the translation component of a 4-by-4 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\n function getTranslation(m, dst) {\n const newDst = (dst ?? new Ctor(3));\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n }\n /**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\n function getAxis(m, axis, dst) {\n const newDst = (dst ?? new Ctor(3));\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n }\n /**\n * Returns the scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\n function getScaling(m, dst) {\n const newDst = (dst ?? new Ctor(3));\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n }\n /**\n * Rotate a 3D vector around the x-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\n function rotateX(a, b, rad, dst) {\n const newDst = (dst ?? new Ctor(3));\n const p = [];\n const r = [];\n //Translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n //perform rotation\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n //translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n return newDst;\n }\n /**\n * Rotate a 3D vector around the y-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns the rotated vector\n */\n function rotateY(a, b, rad, dst) {\n const newDst = (dst ?? new Ctor(3));\n const p = [];\n const r = [];\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n // perform rotation\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n return newDst;\n }\n /**\n * Rotate a 3D vector around the z-axis\n *\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @param dst - The vector to set. If not passed a new one is created.\n * @returns {vec3} out\n */\n function rotateZ(a, b, rad, dst) {\n const newDst = (dst ?? new Ctor(3));\n const p = [];\n const r = [];\n // translate point to the origin\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2];\n // perform rotation\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2];\n // translate to correct position\n newDst[0] = r[0] + b[0];\n newDst[1] = r[1] + b[1];\n newDst[2] = r[2] + b[2];\n return newDst;\n }\n /**\n * Treat a 3D vector as a direction and set it's length\n *\n * @param a The vec3 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\n function setLength(a, len, dst) {\n const newDst = (dst ?? new Ctor(3));\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n }\n /**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec3 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\n function truncate(a, maxLen, dst) {\n const newDst = (dst ?? new Ctor(3));\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n return copy(a, newDst);\n }\n /**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\n function midpoint(a, b, dst) {\n const newDst = (dst ?? new Ctor(3));\n return lerp(a, b, 0.5, newDst);\n }\n return {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n angle,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n cross,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n random,\n zero,\n transformMat4,\n transformMat4Upper3x3,\n transformMat3,\n transformQuat,\n getTranslation,\n getAxis,\n getScaling,\n rotateX,\n rotateY,\n rotateZ,\n setLength,\n truncate,\n midpoint,\n };\n}\nconst cache$4 = new Map();\nfunction getAPI$4(Ctor) {\n let api = cache$4.get(Ctor);\n if (!api) {\n api = getAPIImpl$4(Ctor);\n cache$4.set(Ctor, api);\n }\n return api;\n}\n\n/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n * Generates a typed API for Mat3\n * */\nfunction getAPIImpl$3(Ctor) {\n const vec2 = getAPI$5(Ctor);\n const vec3 = getAPI$4(Ctor);\n /**\n * Create a Mat3 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat3's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat3.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @returns matrix created from values.\n */\n function create(v0, v1, v2, v3, v4, v5, v6, v7, v8) {\n const newDst = new Ctor(12);\n // to make the array homogenous\n newDst[3] = 0;\n newDst[7] = 0;\n newDst[11] = 0;\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[4] = v3;\n if (v4 !== undefined) {\n newDst[5] = v4;\n if (v5 !== undefined) {\n newDst[6] = v5;\n if (v6 !== undefined) {\n newDst[8] = v6;\n if (v7 !== undefined) {\n newDst[9] = v7;\n if (v8 !== undefined) {\n newDst[10] = v8;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n }\n /**\n * Sets the values of a Mat3\n * Also see {@link mat3.create} and {@link mat3.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 set from values.\n */\n function set(v0, v1, v2, v3, v4, v5, v6, v7, v8, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = v0;\n newDst[1] = v1;\n newDst[2] = v2;\n newDst[3] = 0;\n newDst[4] = v3;\n newDst[5] = v4;\n newDst[6] = v5;\n newDst[7] = 0;\n newDst[8] = v6;\n newDst[9] = v7;\n newDst[10] = v8;\n newDst[11] = 0;\n return newDst;\n }\n /**\n * Creates a Mat3 from the upper left 3x3 part of a Mat4\n * @param m4 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from m4\n */\n function fromMat4(m4, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = m4[0];\n newDst[1] = m4[1];\n newDst[2] = m4[2];\n newDst[3] = 0;\n newDst[4] = m4[4];\n newDst[5] = m4[5];\n newDst[6] = m4[6];\n newDst[7] = 0;\n newDst[8] = m4[8];\n newDst[9] = m4[9];\n newDst[10] = m4[10];\n newDst[11] = 0;\n return newDst;\n }\n /**\n * Creates a Mat3 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat3 made from q\n */\n function fromQuat(q, dst) {\n const newDst = (dst ?? new Ctor(12));\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n newDst[0] = 1 - yy - zz;\n newDst[1] = yx + wz;\n newDst[2] = zx - wy;\n newDst[3] = 0;\n newDst[4] = yx - wz;\n newDst[5] = 1 - xx - zz;\n newDst[6] = zy + wx;\n newDst[7] = 0;\n newDst[8] = zx + wy;\n newDst[9] = zy - wx;\n newDst[10] = 1 - xx - yy;\n newDst[11] = 0;\n return newDst;\n }\n /**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\n function negate(m, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = -m[0];\n newDst[1] = -m[1];\n newDst[2] = -m[2];\n newDst[4] = -m[4];\n newDst[5] = -m[5];\n newDst[6] = -m[6];\n newDst[8] = -m[8];\n newDst[9] = -m[9];\n newDst[10] = -m[10];\n return newDst;\n }\n /**\n * Copies a matrix. (same as {@link mat3.clone})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\n function copy(m, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = m[0];\n newDst[1] = m[1];\n newDst[2] = m[2];\n newDst[4] = m[4];\n newDst[5] = m[5];\n newDst[6] = m[6];\n newDst[8] = m[8];\n newDst[9] = m[9];\n newDst[10] = m[10];\n return newDst;\n }\n /**\n * Copies a matrix (same as {@link mat3.copy})\n * Also see {@link mat3.create} and {@link mat3.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\n const clone = copy;\n /**\n * Check if 2 matrices are approximately equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are approximately equal\n */\n function equalsApproximately(a, b) {\n return Math.abs(a[0] - b[0]) < EPSILON &&\n Math.abs(a[1] - b[1]) < EPSILON &&\n Math.abs(a[2] - b[2]) < EPSILON &&\n Math.abs(a[4] - b[4]) < EPSILON &&\n Math.abs(a[5] - b[5]) < EPSILON &&\n Math.abs(a[6] - b[6]) < EPSILON &&\n Math.abs(a[8] - b[8]) < EPSILON &&\n Math.abs(a[9] - b[9]) < EPSILON &&\n Math.abs(a[10] - b[10]) < EPSILON;\n }\n /**\n * Check if 2 matrices are exactly equal\n * @param a Operand matrix.\n * @param b Operand matrix.\n * @returns true if matrices are exactly equal\n */\n function equals(a, b) {\n return a[0] === b[0] &&\n a[1] === b[1] &&\n a[2] === b[2] &&\n a[4] === b[4] &&\n a[5] === b[5] &&\n a[6] === b[6] &&\n a[8] === b[8] &&\n a[9] === b[9] &&\n a[10] === b[10];\n }\n /**\n * Creates a 3-by-3 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 3-by-3 identity matrix.\n */\n function identity(dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = 1;\n newDst[6] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n return newDst;\n }\n /**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\n function transpose(m, dst) {\n const newDst = (dst ?? new Ctor(12));\n if (newDst === m) {\n let t;\n // 0 1 2\n // 4 5 6\n // 8 9 10\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n return newDst;\n }\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n newDst[0] = m00;\n newDst[1] = m10;\n newDst[2] = m20;\n newDst[4] = m01;\n newDst[5] = m11;\n newDst[6] = m21;\n newDst[8] = m02;\n newDst[9] = m12;\n newDst[10] = m22;\n return newDst;\n }\n /**\n * Computes the inverse of a 3-by-3 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\n function inverse(m, dst) {\n const newDst = (dst ?? new Ctor(12));\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const b01 = m22 * m11 - m12 * m21;\n const b11 = -m22 * m10 + m12 * m20;\n const b21 = m21 * m10 - m11 * m20;\n const invDet = 1 / (m00 * b01 + m01 * b11 + m02 * b21);\n newDst[0] = b01 * invDet;\n newDst[1] = (-m22 * m01 + m02 * m21) * invDet;\n newDst[2] = (m12 * m01 - m02 * m11) * invDet;\n newDst[4] = b11 * invDet;\n newDst[5] = (m22 * m00 - m02 * m20) * invDet;\n newDst[6] = (-m12 * m00 + m02 * m10) * invDet;\n newDst[8] = b21 * invDet;\n newDst[9] = (-m21 * m00 + m01 * m20) * invDet;\n newDst[10] = (m11 * m00 - m01 * m10) * invDet;\n return newDst;\n }\n /**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\n function determinant(m) {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n return m00 * (m11 * m22 - m21 * m12) -\n m10 * (m01 * m22 - m21 * m02) +\n m20 * (m01 * m12 - m11 * m02);\n }\n /**\n * Computes the inverse of a 3-by-3 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\n const invert = inverse;\n /**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\n function multiply(a, b, dst) {\n const newDst = (dst ?? new Ctor(12));\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a10 = a[4 + 0];\n const a11 = a[4 + 1];\n const a12 = a[4 + 2];\n const a20 = a[8 + 0];\n const a21 = a[8 + 1];\n const a22 = a[8 + 2];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b10 = b[4 + 0];\n const b11 = b[4 + 1];\n const b12 = b[4 + 2];\n const b20 = b[8 + 0];\n const b21 = b[8 + 1];\n const b22 = b[8 + 2];\n newDst[0] = a00 * b00 + a10 * b01 + a20 * b02;\n newDst[1] = a01 * b00 + a11 * b01 + a21 * b02;\n newDst[2] = a02 * b00 + a12 * b01 + a22 * b02;\n newDst[4] = a00 * b10 + a10 * b11 + a20 * b12;\n newDst[5] = a01 * b10 + a11 * b11 + a21 * b12;\n newDst[6] = a02 * b10 + a12 * b11 + a22 * b12;\n newDst[8] = a00 * b20 + a10 * b21 + a20 * b22;\n newDst[9] = a01 * b20 + a11 * b21 + a21 * b22;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22;\n return newDst;\n }\n /**\n * Multiplies two 3-by-3 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\n const mul = multiply;\n /**\n * Sets the translation component of a 3-by-3 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\n function setTranslation(a, v, dst) {\n const newDst = (dst ?? identity());\n if (a !== newDst) {\n newDst[0] = a[0];\n newDst[1] = a[1];\n newDst[2] = a[2];\n newDst[4] = a[4];\n newDst[5] = a[5];\n newDst[6] = a[6];\n }\n newDst[8] = v[0];\n newDst[9] = v[1];\n newDst[10] = 1;\n return newDst;\n }\n /**\n * Returns the translation component of a 3-by-3 matrix as a vector with 3\n * entries.\n * @param m - The matrix.\n * @param dst - vector to hold result. If not passed a new one is created.\n * @returns The translation component of m.\n */\n function getTranslation(m, dst) {\n const newDst = (dst ?? vec2.create());\n newDst[0] = m[8];\n newDst[1] = m[9];\n return newDst;\n }\n /**\n * Returns an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y,\n * @returns The axis component of m.\n */\n function getAxis(m, axis, dst) {\n const newDst = (dst ?? vec2.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n return newDst;\n }\n /**\n * Sets an axis of a 3x3 matrix as a vector with 2 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\n function setAxis(m, v, axis, dst) {\n const newDst = (dst === m ? m : copy(m, dst));\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n return newDst;\n }\n /**\n * Returns the \"2d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\n function getScaling(m, dst) {\n const newDst = (dst ?? vec2.create());\n const xx = m[0];\n const xy = m[1];\n const yx = m[4];\n const yy = m[5];\n newDst[0] = Math.sqrt(xx * xx + xy * xy);\n newDst[1] = Math.sqrt(yx * yx + yy * yy);\n return newDst;\n }\n /**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\n function get3DScaling(m, dst) {\n const newDst = (dst ?? vec3.create());\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which translates by the given vector v.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\n function translation(v, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = 1;\n newDst[6] = 0;\n newDst[8] = v[0];\n newDst[9] = v[1];\n newDst[10] = 1;\n return newDst;\n }\n /**\n * Translates the given 3-by-3 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\n function translate(m, v, dst) {\n const newDst = (dst ?? new Ctor(12));\n const v0 = v[0];\n const v1 = v[1];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n if (m !== newDst) {\n newDst[0] = m00;\n newDst[1] = m01;\n newDst[2] = m02;\n newDst[4] = m10;\n newDst[5] = m11;\n newDst[6] = m12;\n }\n newDst[8] = m00 * v0 + m10 * v1 + m20;\n newDst[9] = m01 * v0 + m11 * v1 + m21;\n newDst[10] = m02 * v0 + m12 * v1 + m22;\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which rotates by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n function rotation(angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(12));\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c;\n newDst[1] = s;\n newDst[2] = 0;\n newDst[4] = -s;\n newDst[5] = c;\n newDst[6] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n return newDst;\n }\n /**\n * Rotates the given 3-by-3 matrix by the given angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function rotate(m, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(12));\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c * m00 + s * m10;\n newDst[1] = c * m01 + s * m11;\n newDst[2] = c * m02 + s * m12;\n newDst[4] = c * m10 - s * m00;\n newDst[5] = c * m11 - s * m01;\n newDst[6] = c * m12 - s * m02;\n if (m !== newDst) {\n newDst[8] = m[8];\n newDst[9] = m[9];\n newDst[10] = m[10];\n }\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n function rotationX(angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(12));\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = c;\n newDst[6] = s;\n newDst[8] = 0;\n newDst[9] = -s;\n newDst[10] = c;\n return newDst;\n }\n /**\n * Rotates the given 3-by-3 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function rotateX(m, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(12));\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n if (m !== newDst) {\n newDst[0] = m[0];\n newDst[1] = m[1];\n newDst[2] = m[2];\n }\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n function rotationY(angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(12));\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c;\n newDst[1] = 0;\n newDst[2] = -s;\n newDst[4] = 0;\n newDst[5] = 1;\n newDst[6] = 0;\n newDst[8] = s;\n newDst[9] = 0;\n newDst[10] = c;\n return newDst;\n }\n /**\n * Rotates the given 3-by-3 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function rotateY(m, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(12));\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c * m00 - s * m20;\n newDst[1] = c * m01 - s * m21;\n newDst[2] = c * m02 - s * m22;\n newDst[8] = c * m20 + s * m00;\n newDst[9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n if (m !== newDst) {\n newDst[4] = m[4];\n newDst[5] = m[5];\n newDst[6] = m[6];\n }\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n const rotationZ = rotation;\n /**\n * Rotates the given 3-by-3 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n const rotateZ = rotate;\n /**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has two\n * entries.\n * @param v - A vector of\n * 2 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\n function scaling(v, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = v[0];\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = v[1];\n newDst[6] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n return newDst;\n }\n /**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * two entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 2 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\n function scale(m, v, dst) {\n const newDst = (dst ?? new Ctor(12));\n const v0 = v[0];\n const v1 = v[1];\n newDst[0] = v0 * m[0 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2];\n newDst[4] = v1 * m[1 * 4 + 0];\n newDst[5] = v1 * m[1 * 4 + 1];\n newDst[6] = v1 * m[1 * 4 + 2];\n if (m !== newDst) {\n newDst[8] = m[8];\n newDst[9] = m[9];\n newDst[10] = m[10];\n }\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * 3 entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\n function scaling3D(v, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = v[0];\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = v[1];\n newDst[6] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = v[2];\n return newDst;\n }\n /**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of 3 entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\n function scale3D(m, v, dst) {\n const newDst = (dst ?? new Ctor(12));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n newDst[0] = v0 * m[0 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2];\n newDst[4] = v1 * m[1 * 4 + 0];\n newDst[5] = v1 * m[1 * 4 + 1];\n newDst[6] = v1 * m[1 * 4 + 2];\n newDst[8] = v2 * m[2 * 4 + 0];\n newDst[9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which scales uniformly in the X and Y dimensions\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\n function uniformScaling(s, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = s;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = s;\n newDst[6] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n return newDst;\n }\n /**\n * Scales the given 3-by-3 matrix in the X and Y dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\n function uniformScale(m, s, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = s * m[0 * 4 + 0];\n newDst[1] = s * m[0 * 4 + 1];\n newDst[2] = s * m[0 * 4 + 2];\n newDst[4] = s * m[1 * 4 + 0];\n newDst[5] = s * m[1 * 4 + 1];\n newDst[6] = s * m[1 * 4 + 2];\n if (m !== newDst) {\n newDst[8] = m[8];\n newDst[9] = m[9];\n newDst[10] = m[10];\n }\n return newDst;\n }\n /**\n * Creates a 3-by-3 matrix which scales uniformly in each dimension\n * @param s - Amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\n function uniformScaling3D(s, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = s;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[4] = 0;\n newDst[5] = s;\n newDst[6] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = s;\n return newDst;\n }\n /**\n * Scales the given 3-by-3 matrix in each dimension by an amount\n * given.\n * @param m - The matrix to be modified.\n * @param s - Amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\n function uniformScale3D(m, s, dst) {\n const newDst = (dst ?? new Ctor(12));\n newDst[0] = s * m[0 * 4 + 0];\n newDst[1] = s * m[0 * 4 + 1];\n newDst[2] = s * m[0 * 4 + 2];\n newDst[4] = s * m[1 * 4 + 0];\n newDst[5] = s * m[1 * 4 + 1];\n newDst[6] = s * m[1 * 4 + 2];\n newDst[8] = s * m[2 * 4 + 0];\n newDst[9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n return newDst;\n }\n return {\n clone,\n create,\n set,\n fromMat4,\n fromQuat,\n negate,\n copy,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n invert,\n determinant,\n mul,\n multiply,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n get3DScaling,\n translation,\n translate,\n rotation,\n rotate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n scaling3D,\n scale3D,\n uniformScaling3D,\n uniformScale3D,\n };\n}\nconst cache$3 = new Map();\nfunction getAPI$3(Ctor) {\n let api = cache$3.get(Ctor);\n if (!api) {\n api = getAPIImpl$3(Ctor);\n cache$3.set(Ctor, api);\n }\n return api;\n}\n\n/**\n * Generates a typed API for Mat4\n * */\nfunction getAPIImpl$2(Ctor) {\n const vec3 = getAPI$4(Ctor);\n /**\n * 4x4 Matrix math math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new matrix. In other words you can do this\n *\n * const mat = mat4.translation([1, 2, 3]); // Creates a new translation matrix\n *\n * or\n *\n * const mat = mat4.create();\n * mat4.translation([1, 2, 3], mat); // Puts translation matrix in mat.\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always save to pass any matrix as the destination. So for example\n *\n * const mat = mat4.identity();\n * const trans = mat4.translation([1, 2, 3]);\n * mat4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat.\n *\n */\n /**\n * Create a Mat4 from values\n *\n * Note: Since passing in a raw JavaScript array\n * is valid in all circumstances, if you want to\n * force a JavaScript array into a Mat4's specified type\n * it would be faster to use\n *\n * ```\n * const m = mat4.clone(someJSArray);\n * ```\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @returns created from values.\n */\n function create(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) {\n const newDst = new Ctor(16);\n if (v0 !== undefined) {\n newDst[0] = v0;\n if (v1 !== undefined) {\n newDst[1] = v1;\n if (v2 !== undefined) {\n newDst[2] = v2;\n if (v3 !== undefined) {\n newDst[3] = v3;\n if (v4 !== undefined) {\n newDst[4] = v4;\n if (v5 !== undefined) {\n newDst[5] = v5;\n if (v6 !== undefined) {\n newDst[6] = v6;\n if (v7 !== undefined) {\n newDst[7] = v7;\n if (v8 !== undefined) {\n newDst[8] = v8;\n if (v9 !== undefined) {\n newDst[9] = v9;\n if (v10 !== undefined) {\n newDst[10] = v10;\n if (v11 !== undefined) {\n newDst[11] = v11;\n if (v12 !== undefined) {\n newDst[12] = v12;\n if (v13 !== undefined) {\n newDst[13] = v13;\n if (v14 !== undefined) {\n newDst[14] = v14;\n if (v15 !== undefined) {\n newDst[15] = v15;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n return newDst;\n }\n /**\n * Sets the values of a Mat4\n * Also see {@link mat4.create} and {@link mat4.copy}\n *\n * @param v0 - value for element 0\n * @param v1 - value for element 1\n * @param v2 - value for element 2\n * @param v3 - value for element 3\n * @param v4 - value for element 4\n * @param v5 - value for element 5\n * @param v6 - value for element 6\n * @param v7 - value for element 7\n * @param v8 - value for element 8\n * @param v9 - value for element 9\n * @param v10 - value for element 10\n * @param v11 - value for element 11\n * @param v12 - value for element 12\n * @param v13 - value for element 13\n * @param v14 - value for element 14\n * @param v15 - value for element 15\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 created from values.\n */\n function set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = v0;\n newDst[1] = v1;\n newDst[2] = v2;\n newDst[3] = v3;\n newDst[4] = v4;\n newDst[5] = v5;\n newDst[6] = v6;\n newDst[7] = v7;\n newDst[8] = v8;\n newDst[9] = v9;\n newDst[10] = v10;\n newDst[11] = v11;\n newDst[12] = v12;\n newDst[13] = v13;\n newDst[14] = v14;\n newDst[15] = v15;\n return newDst;\n }\n /**\n * Creates a Mat4 from a Mat3\n * @param m3 - source matrix\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from m3\n */\n function fromMat3(m3, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = m3[0];\n newDst[1] = m3[1];\n newDst[2] = m3[2];\n newDst[3] = 0;\n newDst[4] = m3[4];\n newDst[5] = m3[5];\n newDst[6] = m3[6];\n newDst[7] = 0;\n newDst[8] = m3[8];\n newDst[9] = m3[9];\n newDst[10] = m3[10];\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Creates a Mat4 rotation matrix from a quaternion\n * @param q - quaternion to create matrix from\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns Mat4 made from q\n */\n function fromQuat(q, dst) {\n const newDst = (dst ?? new Ctor(16));\n const x = q[0];\n const y = q[1];\n const z = q[2];\n const w = q[3];\n const x2 = x + x;\n const y2 = y + y;\n const z2 = z + z;\n const xx = x * x2;\n const yx = y * x2;\n const yy = y * y2;\n const zx = z * x2;\n const zy = z * y2;\n const zz = z * z2;\n const wx = w * x2;\n const wy = w * y2;\n const wz = w * z2;\n newDst[0] = 1 - yy - zz;\n newDst[1] = yx + wz;\n newDst[2] = zx - wy;\n newDst[3] = 0;\n newDst[4] = yx - wz;\n newDst[5] = 1 - xx - zz;\n newDst[6] = zy + wx;\n newDst[7] = 0;\n newDst[8] = zx + wy;\n newDst[9] = zy - wx;\n newDst[10] = 1 - xx - yy;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Negates a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns -m.\n */\n function negate(m, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = -m[0];\n newDst[1] = -m[1];\n newDst[2] = -m[2];\n newDst[3] = -m[3];\n newDst[4] = -m[4];\n newDst[5] = -m[5];\n newDst[6] = -m[6];\n newDst[7] = -m[7];\n newDst[8] = -m[8];\n newDst[9] = -m[9];\n newDst[10] = -m[10];\n newDst[11] = -m[11];\n newDst[12] = -m[12];\n newDst[13] = -m[13];\n newDst[14] = -m[14];\n newDst[15] = -m[15];\n return newDst;\n }\n /**\n * Copies a matrix. (same as {@link mat4.clone})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\n function copy(m, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = m[0];\n newDst[1] = m[1];\n newDst[2] = m[2];\n newDst[3] = m[3];\n newDst[4] = m[4];\n newDst[5] = m[5];\n newDst[6] = m[6];\n newDst[7] = m[7];\n newDst[8] = m[8];\n newDst[9] = m[9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n return newDst;\n }\n /**\n * Copies a matrix (same as {@link mat4.copy})\n * Also see {@link mat4.create} and {@link mat4.set}\n * @param m - The matrix.\n * @param dst - The matrix. If not passed a new one is created.\n * @returns A copy of m.\n */\n const clone = copy;\n /**\n * Check if 2 matrices are approximately equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are approximately equal\n */\n function equalsApproximately(a, b) {\n return Math.abs(a[0] - b[0]) < EPSILON &&\n Math.abs(a[1] - b[1]) < EPSILON &&\n Math.abs(a[2] - b[2]) < EPSILON &&\n Math.abs(a[3] - b[3]) < EPSILON &&\n Math.abs(a[4] - b[4]) < EPSILON &&\n Math.abs(a[5] - b[5]) < EPSILON &&\n Math.abs(a[6] - b[6]) < EPSILON &&\n Math.abs(a[7] - b[7]) < EPSILON &&\n Math.abs(a[8] - b[8]) < EPSILON &&\n Math.abs(a[9] - b[9]) < EPSILON &&\n Math.abs(a[10] - b[10]) < EPSILON &&\n Math.abs(a[11] - b[11]) < EPSILON &&\n Math.abs(a[12] - b[12]) < EPSILON &&\n Math.abs(a[13] - b[13]) < EPSILON &&\n Math.abs(a[14] - b[14]) < EPSILON &&\n Math.abs(a[15] - b[15]) < EPSILON;\n }\n /**\n * Check if 2 matrices are exactly equal\n * @param a - Operand matrix.\n * @param b - Operand matrix.\n * @returns true if matrices are exactly equal\n */\n function equals(a, b) {\n return a[0] === b[0] &&\n a[1] === b[1] &&\n a[2] === b[2] &&\n a[3] === b[3] &&\n a[4] === b[4] &&\n a[5] === b[5] &&\n a[6] === b[6] &&\n a[7] === b[7] &&\n a[8] === b[8] &&\n a[9] === b[9] &&\n a[10] === b[10] &&\n a[11] === b[11] &&\n a[12] === b[12] &&\n a[13] === b[13] &&\n a[14] === b[14] &&\n a[15] === b[15];\n }\n /**\n * Creates a 4-by-4 identity matrix.\n *\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A 4-by-4 identity matrix.\n */\n function identity(dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = 1;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Takes the transpose of a matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The transpose of m.\n */\n function transpose(m, dst) {\n const newDst = (dst ?? new Ctor(16));\n if (newDst === m) {\n let t;\n t = m[1];\n m[1] = m[4];\n m[4] = t;\n t = m[2];\n m[2] = m[8];\n m[8] = t;\n t = m[3];\n m[3] = m[12];\n m[12] = t;\n t = m[6];\n m[6] = m[9];\n m[9] = t;\n t = m[7];\n m[7] = m[13];\n m[13] = t;\n t = m[11];\n m[11] = m[14];\n m[14] = t;\n return newDst;\n }\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n newDst[0] = m00;\n newDst[1] = m10;\n newDst[2] = m20;\n newDst[3] = m30;\n newDst[4] = m01;\n newDst[5] = m11;\n newDst[6] = m21;\n newDst[7] = m31;\n newDst[8] = m02;\n newDst[9] = m12;\n newDst[10] = m22;\n newDst[11] = m32;\n newDst[12] = m03;\n newDst[13] = m13;\n newDst[14] = m23;\n newDst[15] = m33;\n return newDst;\n }\n /**\n * Computes the inverse of a 4-by-4 matrix.\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\n function inverse(m, dst) {\n const newDst = (dst ?? new Ctor(16));\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const tmp12 = m20 * m31;\n const tmp13 = m30 * m21;\n const tmp14 = m10 * m31;\n const tmp15 = m30 * m11;\n const tmp16 = m10 * m21;\n const tmp17 = m20 * m11;\n const tmp18 = m00 * m31;\n const tmp19 = m30 * m01;\n const tmp20 = m00 * m21;\n const tmp21 = m20 * m01;\n const tmp22 = m00 * m11;\n const tmp23 = m10 * m01;\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n const d = 1 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3);\n newDst[0] = d * t0;\n newDst[1] = d * t1;\n newDst[2] = d * t2;\n newDst[3] = d * t3;\n newDst[4] = d * ((tmp1 * m10 + tmp2 * m20 + tmp5 * m30) -\n (tmp0 * m10 + tmp3 * m20 + tmp4 * m30));\n newDst[5] = d * ((tmp0 * m00 + tmp7 * m20 + tmp8 * m30) -\n (tmp1 * m00 + tmp6 * m20 + tmp9 * m30));\n newDst[6] = d * ((tmp3 * m00 + tmp6 * m10 + tmp11 * m30) -\n (tmp2 * m00 + tmp7 * m10 + tmp10 * m30));\n newDst[7] = d * ((tmp4 * m00 + tmp9 * m10 + tmp10 * m20) -\n (tmp5 * m00 + tmp8 * m10 + tmp11 * m20));\n newDst[8] = d * ((tmp12 * m13 + tmp15 * m23 + tmp16 * m33) -\n (tmp13 * m13 + tmp14 * m23 + tmp17 * m33));\n newDst[9] = d * ((tmp13 * m03 + tmp18 * m23 + tmp21 * m33) -\n (tmp12 * m03 + tmp19 * m23 + tmp20 * m33));\n newDst[10] = d * ((tmp14 * m03 + tmp19 * m13 + tmp22 * m33) -\n (tmp15 * m03 + tmp18 * m13 + tmp23 * m33));\n newDst[11] = d * ((tmp17 * m03 + tmp20 * m13 + tmp23 * m23) -\n (tmp16 * m03 + tmp21 * m13 + tmp22 * m23));\n newDst[12] = d * ((tmp14 * m22 + tmp17 * m32 + tmp13 * m12) -\n (tmp16 * m32 + tmp12 * m12 + tmp15 * m22));\n newDst[13] = d * ((tmp20 * m32 + tmp12 * m02 + tmp19 * m22) -\n (tmp18 * m22 + tmp21 * m32 + tmp13 * m02));\n newDst[14] = d * ((tmp18 * m12 + tmp23 * m32 + tmp15 * m02) -\n (tmp22 * m32 + tmp14 * m02 + tmp19 * m12));\n newDst[15] = d * ((tmp22 * m22 + tmp16 * m02 + tmp21 * m12) -\n (tmp20 * m12 + tmp23 * m22 + tmp17 * m02));\n return newDst;\n }\n /**\n * Compute the determinant of a matrix\n * @param m - the matrix\n * @returns the determinant\n */\n function determinant(m) {\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n const tmp0 = m22 * m33;\n const tmp1 = m32 * m23;\n const tmp2 = m12 * m33;\n const tmp3 = m32 * m13;\n const tmp4 = m12 * m23;\n const tmp5 = m22 * m13;\n const tmp6 = m02 * m33;\n const tmp7 = m32 * m03;\n const tmp8 = m02 * m23;\n const tmp9 = m22 * m03;\n const tmp10 = m02 * m13;\n const tmp11 = m12 * m03;\n const t0 = (tmp0 * m11 + tmp3 * m21 + tmp4 * m31) -\n (tmp1 * m11 + tmp2 * m21 + tmp5 * m31);\n const t1 = (tmp1 * m01 + tmp6 * m21 + tmp9 * m31) -\n (tmp0 * m01 + tmp7 * m21 + tmp8 * m31);\n const t2 = (tmp2 * m01 + tmp7 * m11 + tmp10 * m31) -\n (tmp3 * m01 + tmp6 * m11 + tmp11 * m31);\n const t3 = (tmp5 * m01 + tmp8 * m11 + tmp11 * m21) -\n (tmp4 * m01 + tmp9 * m11 + tmp10 * m21);\n return m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3;\n }\n /**\n * Computes the inverse of a 4-by-4 matrix. (same as inverse)\n * @param m - The matrix.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The inverse of m.\n */\n const invert = inverse;\n /**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\n function multiply(a, b, dst) {\n const newDst = (dst ?? new Ctor(16));\n const a00 = a[0];\n const a01 = a[1];\n const a02 = a[2];\n const a03 = a[3];\n const a10 = a[4 + 0];\n const a11 = a[4 + 1];\n const a12 = a[4 + 2];\n const a13 = a[4 + 3];\n const a20 = a[8 + 0];\n const a21 = a[8 + 1];\n const a22 = a[8 + 2];\n const a23 = a[8 + 3];\n const a30 = a[12 + 0];\n const a31 = a[12 + 1];\n const a32 = a[12 + 2];\n const a33 = a[12 + 3];\n const b00 = b[0];\n const b01 = b[1];\n const b02 = b[2];\n const b03 = b[3];\n const b10 = b[4 + 0];\n const b11 = b[4 + 1];\n const b12 = b[4 + 2];\n const b13 = b[4 + 3];\n const b20 = b[8 + 0];\n const b21 = b[8 + 1];\n const b22 = b[8 + 2];\n const b23 = b[8 + 3];\n const b30 = b[12 + 0];\n const b31 = b[12 + 1];\n const b32 = b[12 + 2];\n const b33 = b[12 + 3];\n newDst[0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;\n newDst[1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;\n newDst[2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;\n newDst[3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;\n newDst[4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;\n newDst[5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;\n newDst[6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;\n newDst[7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;\n newDst[8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;\n newDst[9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;\n newDst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;\n newDst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;\n newDst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;\n newDst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;\n newDst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;\n newDst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;\n return newDst;\n }\n /**\n * Multiplies two 4-by-4 matrices with a on the left and b on the right (same as multiply)\n * @param a - The matrix on the left.\n * @param b - The matrix on the right.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix product of a and b.\n */\n const mul = multiply;\n /**\n * Sets the translation component of a 4-by-4 matrix to the given\n * vector.\n * @param a - The matrix.\n * @param v - The vector.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The matrix with translation set.\n */\n function setTranslation(a, v, dst) {\n const newDst = (dst ?? identity());\n if (a !== newDst) {\n newDst[0] = a[0];\n newDst[1] = a[1];\n newDst[2] = a[2];\n newDst[3] = a[3];\n newDst[4] = a[4];\n newDst[5] = a[5];\n newDst[6] = a[6];\n newDst[7] = a[7];\n newDst[8] = a[8];\n newDst[9] = a[9];\n newDst[10] = a[10];\n newDst[11] = a[11];\n }\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n }\n ///**\n // * Returns the translation component of a 4-by-4 matrix as a vector with 3\n // * entries.\n // * @param m - The matrix.\n // * @param dst - vector to hold result. If not passed a new one is created.\n // * @returns The translation component of m.\n // */\n function getTranslation(m, dst) {\n const newDst = (dst ?? vec3.create());\n newDst[0] = m[12];\n newDst[1] = m[13];\n newDst[2] = m[14];\n return newDst;\n }\n /**\n * Returns an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @returns The axis component of m.\n */\n function getAxis(m, axis, dst) {\n const newDst = (dst ?? vec3.create());\n const off = axis * 4;\n newDst[0] = m[off + 0];\n newDst[1] = m[off + 1];\n newDst[2] = m[off + 2];\n return newDst;\n }\n /**\n * Sets an axis of a 4x4 matrix as a vector with 3 entries\n * @param m - The matrix.\n * @param v - the axis vector\n * @param axis - The axis 0 = x, 1 = y, 2 = z;\n * @param dst - The matrix to set. If not passed a new one is created.\n * @returns The matrix with axis set.\n */\n function setAxis(m, v, axis, dst) {\n const newDst = (dst === m) ? dst : copy(m, dst);\n const off = axis * 4;\n newDst[off + 0] = v[0];\n newDst[off + 1] = v[1];\n newDst[off + 2] = v[2];\n return newDst;\n }\n /**\n * Returns the \"3d\" scaling component of the matrix\n * @param m - The Matrix\n * @param dst - The vector to set. If not passed a new one is created.\n */\n function getScaling(m, dst) {\n const newDst = (dst ?? vec3.create());\n const xx = m[0];\n const xy = m[1];\n const xz = m[2];\n const yx = m[4];\n const yy = m[5];\n const yz = m[6];\n const zx = m[8];\n const zy = m[9];\n const zz = m[10];\n newDst[0] = Math.sqrt(xx * xx + xy * xy + xz * xz);\n newDst[1] = Math.sqrt(yx * yx + yy * yy + yz * yz);\n newDst[2] = Math.sqrt(zx * zx + zy * zy + zz * zz);\n return newDst;\n }\n /**\n * Computes a 4-by-4 perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 0 to 1 in the z dimension.\n *\n * Note: If you pass `Infinity` for zFar then it will produce a projection matrix\n * returns -Infinity for Z when transforming coordinates with Z <= 0 and +Infinity for Z\n * otherwise.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */\n function perspective(fieldOfViewYInRadians, aspect, zNear, zFar, dst) {\n const newDst = (dst ?? new Ctor(16));\n const f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians);\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n if (Number.isFinite(zFar)) {\n const rangeInv = 1 / (zNear - zFar);\n newDst[10] = zFar * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n else {\n newDst[10] = -1;\n newDst[14] = -zNear;\n }\n return newDst;\n }\n /**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the angular height\n * of the frustum, the aspect ratio, and the near and far clipping planes. The\n * arguments define a frustum extending in the negative z direction. The given\n * angle is the vertical angle of the frustum, and the horizontal angle is\n * determined to produce the given aspect ratio. The arguments near and far are\n * the distances to the near and far clipping planes. Note that near and far\n * are not z coordinates, but rather they are distances along the negative\n * z-axis. The matrix generated sends the viewing frustum to the unit box.\n * We assume a unit box extending from -1 to 1 in the x and y dimensions and\n * from 1 (at -zNear) to 0 (at -zFar) in the z dimension.\n *\n * @param fieldOfViewYInRadians - The camera angle from top to bottom (in radians).\n * @param aspect - The aspect ratio width / height.\n * @param zNear - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param zFar - The depth (negative z coordinate)\n * of the far clipping plane. (default = Infinity)\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The perspective matrix.\n */ function perspectiveReverseZ(fieldOfViewYInRadians, aspect, zNear, zFar = Infinity, dst) {\n const newDst = (dst ?? new Ctor(16));\n const f = 1 / Math.tan(fieldOfViewYInRadians * 0.5);\n newDst[0] = f / aspect;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = f;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n if (zFar === Infinity) {\n newDst[10] = 0;\n newDst[14] = zNear;\n }\n else {\n const rangeInv = 1 / (zFar - zNear);\n newDst[10] = zNear * rangeInv;\n newDst[14] = zFar * zNear * rangeInv;\n }\n return newDst;\n }\n /**\n * Computes a 4-by-4 orthogonal transformation matrix that transforms from\n * the given the left, right, bottom, and top dimensions to -1 +1 in x, and y\n * and 0 to +1 in z.\n * @param left - Left side of the near clipping plane viewport.\n * @param right - Right side of the near clipping plane viewport.\n * @param bottom - Bottom of the near clipping plane viewport.\n * @param top - Top of the near clipping plane viewport.\n * @param near - The depth (negative z coordinate)\n * of the near clipping plane.\n * @param far - The depth (negative z coordinate)\n * of the far clipping plane.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The orthographic projection matrix.\n */\n function ortho(left, right, bottom, top, near, far, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = 2 / (right - left);\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = 2 / (top - bottom);\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1 / (near - far);\n newDst[11] = 0;\n newDst[12] = (right + left) / (left - right);\n newDst[13] = (top + bottom) / (bottom - top);\n newDst[14] = near / (near - far);\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Computes a 4-by-4 perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\n function frustum(left, right, bottom, top, near, far, dst) {\n const newDst = (dst ?? new Ctor(16));\n const dx = (right - left);\n const dy = (top - bottom);\n const dz = (near - far);\n newDst[0] = 2 * near / dx;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = 2 * near / dy;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = (left + right) / dx;\n newDst[9] = (top + bottom) / dy;\n newDst[10] = far / dz;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = near * far / dz;\n newDst[15] = 0;\n return newDst;\n }\n /**\n * Computes a 4-by-4 reverse-z perspective transformation matrix given the left, right,\n * top, bottom, near and far clipping planes. The arguments define a frustum\n * extending in the negative z direction. The arguments near and far are the\n * distances to the near and far clipping planes. Note that near and far are not\n * z coordinates, but rather they are distances along the negative z-axis. The\n * matrix generated sends the viewing frustum to the unit box. We assume a unit\n * box extending from -1 to 1 in the x and y dimensions and from 1 (-near) to 0 (-far) in the z\n * dimension.\n * @param left - The x coordinate of the left plane of the box.\n * @param right - The x coordinate of the right plane of the box.\n * @param bottom - The y coordinate of the bottom plane of the box.\n * @param top - The y coordinate of the right plane of the box.\n * @param near - The negative z coordinate of the near plane of the box.\n * @param far - The negative z coordinate of the far plane of the box.\n * @param dst - Output matrix. If not passed a new one is created.\n * @returns The perspective projection matrix.\n */\n function frustumReverseZ(left, right, bottom, top, near, far = Infinity, dst) {\n const newDst = (dst ?? new Ctor(16));\n const dx = (right - left);\n const dy = (top - bottom);\n newDst[0] = 2 * near / dx;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = 2 * near / dy;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = (left + right) / dx;\n newDst[9] = (top + bottom) / dy;\n newDst[11] = -1;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[15] = 0;\n if (far === Infinity) {\n newDst[10] = 0;\n newDst[14] = near;\n }\n else {\n const rangeInv = 1 / (far - near);\n newDst[10] = near * rangeInv;\n newDst[14] = far * near * rangeInv;\n }\n return newDst;\n }\n const xAxis = vec3.create();\n const yAxis = vec3.create();\n const zAxis = vec3.create();\n /**\n * Computes a 4-by-4 aim transformation.\n *\n * This is a matrix which positions an object aiming down positive Z.\n * toward the target.\n *\n * Note: this is **NOT** the inverse of lookAt as lookAt looks at negative Z.\n *\n * @param position - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\n function aim(position, target, up, dst) {\n const newDst = (dst ?? new Ctor(16));\n vec3.normalize(vec3.subtract(target, position, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n newDst[0] = xAxis[0];\n newDst[1] = xAxis[1];\n newDst[2] = xAxis[2];\n newDst[3] = 0;\n newDst[4] = yAxis[0];\n newDst[5] = yAxis[1];\n newDst[6] = yAxis[2];\n newDst[7] = 0;\n newDst[8] = zAxis[0];\n newDst[9] = zAxis[1];\n newDst[10] = zAxis[2];\n newDst[11] = 0;\n newDst[12] = position[0];\n newDst[13] = position[1];\n newDst[14] = position[2];\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Computes a 4-by-4 camera aim transformation.\n *\n * This is a matrix which positions an object aiming down negative Z.\n * toward the target.\n *\n * Note: this is the inverse of `lookAt`\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The aim matrix.\n */\n function cameraAim(eye, target, up, dst) {\n const newDst = (dst ?? new Ctor(16));\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n newDst[0] = xAxis[0];\n newDst[1] = xAxis[1];\n newDst[2] = xAxis[2];\n newDst[3] = 0;\n newDst[4] = yAxis[0];\n newDst[5] = yAxis[1];\n newDst[6] = yAxis[2];\n newDst[7] = 0;\n newDst[8] = zAxis[0];\n newDst[9] = zAxis[1];\n newDst[10] = zAxis[2];\n newDst[11] = 0;\n newDst[12] = eye[0];\n newDst[13] = eye[1];\n newDst[14] = eye[2];\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Computes a 4-by-4 view transformation.\n *\n * This is a view matrix which transforms all other objects\n * to be in the space of the view defined by the parameters.\n *\n * @param eye - The position of the object.\n * @param target - The position meant to be aimed at.\n * @param up - A vector pointing up.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The look-at matrix.\n */\n function lookAt(eye, target, up, dst) {\n const newDst = (dst ?? new Ctor(16));\n vec3.normalize(vec3.subtract(eye, target, zAxis), zAxis);\n vec3.normalize(vec3.cross(up, zAxis, xAxis), xAxis);\n vec3.normalize(vec3.cross(zAxis, xAxis, yAxis), yAxis);\n newDst[0] = xAxis[0];\n newDst[1] = yAxis[0];\n newDst[2] = zAxis[0];\n newDst[3] = 0;\n newDst[4] = xAxis[1];\n newDst[5] = yAxis[1];\n newDst[6] = zAxis[1];\n newDst[7] = 0;\n newDst[8] = xAxis[2];\n newDst[9] = yAxis[2];\n newDst[10] = zAxis[2];\n newDst[11] = 0;\n newDst[12] = -(xAxis[0] * eye[0] + xAxis[1] * eye[1] + xAxis[2] * eye[2]);\n newDst[13] = -(yAxis[0] * eye[0] + yAxis[1] * eye[1] + yAxis[2] * eye[2]);\n newDst[14] = -(zAxis[0] * eye[0] + zAxis[1] * eye[1] + zAxis[2] * eye[2]);\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which translates by the given vector v.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translation matrix.\n */\n function translation(v, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = 1;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n newDst[11] = 0;\n newDst[12] = v[0];\n newDst[13] = v[1];\n newDst[14] = v[2];\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Translates the given 4-by-4 matrix by the given vector v.\n * @param m - The matrix.\n * @param v - The vector by\n * which to translate.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The translated matrix.\n */\n function translate(m, v, dst) {\n const newDst = (dst ?? new Ctor(16));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const m30 = m[3 * 4 + 0];\n const m31 = m[3 * 4 + 1];\n const m32 = m[3 * 4 + 2];\n const m33 = m[3 * 4 + 3];\n if (m !== newDst) {\n newDst[0] = m00;\n newDst[1] = m01;\n newDst[2] = m02;\n newDst[3] = m03;\n newDst[4] = m10;\n newDst[5] = m11;\n newDst[6] = m12;\n newDst[7] = m13;\n newDst[8] = m20;\n newDst[9] = m21;\n newDst[10] = m22;\n newDst[11] = m23;\n }\n newDst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30;\n newDst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31;\n newDst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32;\n newDst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33;\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n function rotationX(angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = c;\n newDst[6] = s;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = -s;\n newDst[10] = c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Rotates the given 4-by-4 matrix around the x-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function rotateX(m, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[4] = c * m10 + s * m20;\n newDst[5] = c * m11 + s * m21;\n newDst[6] = c * m12 + s * m22;\n newDst[7] = c * m13 + s * m23;\n newDst[8] = c * m20 - s * m10;\n newDst[9] = c * m21 - s * m11;\n newDst[10] = c * m22 - s * m12;\n newDst[11] = c * m23 - s * m13;\n if (m !== newDst) {\n newDst[0] = m[0];\n newDst[1] = m[1];\n newDst[2] = m[2];\n newDst[3] = m[3];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n function rotationY(angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c;\n newDst[1] = 0;\n newDst[2] = -s;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = 1;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = s;\n newDst[9] = 0;\n newDst[10] = c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Rotates the given 4-by-4 matrix around the y-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function rotateY(m, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m20 = m[2 * 4 + 0];\n const m21 = m[2 * 4 + 1];\n const m22 = m[2 * 4 + 2];\n const m23 = m[2 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c * m00 - s * m20;\n newDst[1] = c * m01 - s * m21;\n newDst[2] = c * m02 - s * m22;\n newDst[3] = c * m03 - s * m23;\n newDst[8] = c * m20 + s * m00;\n newDst[9] = c * m21 + s * m01;\n newDst[10] = c * m22 + s * m02;\n newDst[11] = c * m23 + s * m03;\n if (m !== newDst) {\n newDst[4] = m[4];\n newDst[5] = m[5];\n newDst[6] = m[6];\n newDst[7] = m[7];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotation matrix.\n */\n function rotationZ(angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c;\n newDst[1] = s;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = -s;\n newDst[5] = c;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = 1;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Rotates the given 4-by-4 matrix around the z-axis by the given\n * angle.\n * @param m - The matrix.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function rotateZ(m, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n const m00 = m[0 * 4 + 0];\n const m01 = m[0 * 4 + 1];\n const m02 = m[0 * 4 + 2];\n const m03 = m[0 * 4 + 3];\n const m10 = m[1 * 4 + 0];\n const m11 = m[1 * 4 + 1];\n const m12 = m[1 * 4 + 2];\n const m13 = m[1 * 4 + 3];\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n newDst[0] = c * m00 + s * m10;\n newDst[1] = c * m01 + s * m11;\n newDst[2] = c * m02 + s * m12;\n newDst[3] = c * m03 + s * m13;\n newDst[4] = c * m10 - s * m00;\n newDst[5] = c * m11 - s * m01;\n newDst[6] = c * m12 - s * m02;\n newDst[7] = c * m13 - s * m03;\n if (m !== newDst) {\n newDst[8] = m[8];\n newDst[9] = m[9];\n newDst[10] = m[10];\n newDst[11] = m[11];\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\n function axisRotation(axis, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n newDst[0] = xx + (1 - xx) * c;\n newDst[1] = x * y * oneMinusCosine + z * s;\n newDst[2] = x * z * oneMinusCosine - y * s;\n newDst[3] = 0;\n newDst[4] = x * y * oneMinusCosine - z * s;\n newDst[5] = yy + (1 - yy) * c;\n newDst[6] = y * z * oneMinusCosine + x * s;\n newDst[7] = 0;\n newDst[8] = x * z * oneMinusCosine + y * s;\n newDst[9] = y * z * oneMinusCosine - x * s;\n newDst[10] = zz + (1 - zz) * c;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which rotates around the given axis by the given\n * angle. (same as axisRotation)\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns A matrix which rotates angle radians\n * around the axis.\n */\n const rotation = axisRotation;\n /**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle.\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n function axisRotate(m, axis, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(16));\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n const n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n const xx = x * x;\n const yy = y * y;\n const zz = z * z;\n const c = Math.cos(angleInRadians);\n const s = Math.sin(angleInRadians);\n const oneMinusCosine = 1 - c;\n const r00 = xx + (1 - xx) * c;\n const r01 = x * y * oneMinusCosine + z * s;\n const r02 = x * z * oneMinusCosine - y * s;\n const r10 = x * y * oneMinusCosine - z * s;\n const r11 = yy + (1 - yy) * c;\n const r12 = y * z * oneMinusCosine + x * s;\n const r20 = x * z * oneMinusCosine + y * s;\n const r21 = y * z * oneMinusCosine - x * s;\n const r22 = zz + (1 - zz) * c;\n const m00 = m[0];\n const m01 = m[1];\n const m02 = m[2];\n const m03 = m[3];\n const m10 = m[4];\n const m11 = m[5];\n const m12 = m[6];\n const m13 = m[7];\n const m20 = m[8];\n const m21 = m[9];\n const m22 = m[10];\n const m23 = m[11];\n newDst[0] = r00 * m00 + r01 * m10 + r02 * m20;\n newDst[1] = r00 * m01 + r01 * m11 + r02 * m21;\n newDst[2] = r00 * m02 + r01 * m12 + r02 * m22;\n newDst[3] = r00 * m03 + r01 * m13 + r02 * m23;\n newDst[4] = r10 * m00 + r11 * m10 + r12 * m20;\n newDst[5] = r10 * m01 + r11 * m11 + r12 * m21;\n newDst[6] = r10 * m02 + r11 * m12 + r12 * m22;\n newDst[7] = r10 * m03 + r11 * m13 + r12 * m23;\n newDst[8] = r20 * m00 + r21 * m10 + r22 * m20;\n newDst[9] = r20 * m01 + r21 * m11 + r22 * m21;\n newDst[10] = r20 * m02 + r21 * m12 + r22 * m22;\n newDst[11] = r20 * m03 + r21 * m13 + r22 * m23;\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n return newDst;\n }\n /**\n * Rotates the given 4-by-4 matrix around the given axis by the\n * given angle. (same as rotate)\n * @param m - The matrix.\n * @param axis - The axis\n * about which to rotate.\n * @param angleInRadians - The angle by which to rotate (in radians).\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The rotated matrix.\n */\n const rotate = axisRotate;\n /**\n * Creates a 4-by-4 matrix which scales in each dimension by an amount given by\n * the corresponding entry in the given vector; assumes the vector has three\n * entries.\n * @param v - A vector of\n * three entries specifying the factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\n function scaling(v, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = v[0];\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = v[1];\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = v[2];\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Scales the given 4-by-4 matrix in each dimension by an amount\n * given by the corresponding entry in the given vector; assumes the vector has\n * three entries.\n * @param m - The matrix to be modified.\n * @param v - A vector of three entries specifying the\n * factor by which to scale in each dimension.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\n function scale(m, v, dst) {\n const newDst = (dst ?? new Ctor(16));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n newDst[0] = v0 * m[0 * 4 + 0];\n newDst[1] = v0 * m[0 * 4 + 1];\n newDst[2] = v0 * m[0 * 4 + 2];\n newDst[3] = v0 * m[0 * 4 + 3];\n newDst[4] = v1 * m[1 * 4 + 0];\n newDst[5] = v1 * m[1 * 4 + 1];\n newDst[6] = v1 * m[1 * 4 + 2];\n newDst[7] = v1 * m[1 * 4 + 3];\n newDst[8] = v2 * m[2 * 4 + 0];\n newDst[9] = v2 * m[2 * 4 + 1];\n newDst[10] = v2 * m[2 * 4 + 2];\n newDst[11] = v2 * m[2 * 4 + 3];\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n return newDst;\n }\n /**\n * Creates a 4-by-4 matrix which scales a uniform amount in each dimension.\n * @param s - the amount to scale\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaling matrix.\n */\n function uniformScaling(s, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = s;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n newDst[4] = 0;\n newDst[5] = s;\n newDst[6] = 0;\n newDst[7] = 0;\n newDst[8] = 0;\n newDst[9] = 0;\n newDst[10] = s;\n newDst[11] = 0;\n newDst[12] = 0;\n newDst[13] = 0;\n newDst[14] = 0;\n newDst[15] = 1;\n return newDst;\n }\n /**\n * Scales the given 4-by-4 matrix in each dimension by a uniform scale.\n * @param m - The matrix to be modified.\n * @param s - The amount to scale.\n * @param dst - matrix to hold result. If not passed a new one is created.\n * @returns The scaled matrix.\n */\n function uniformScale(m, s, dst) {\n const newDst = (dst ?? new Ctor(16));\n newDst[0] = s * m[0 * 4 + 0];\n newDst[1] = s * m[0 * 4 + 1];\n newDst[2] = s * m[0 * 4 + 2];\n newDst[3] = s * m[0 * 4 + 3];\n newDst[4] = s * m[1 * 4 + 0];\n newDst[5] = s * m[1 * 4 + 1];\n newDst[6] = s * m[1 * 4 + 2];\n newDst[7] = s * m[1 * 4 + 3];\n newDst[8] = s * m[2 * 4 + 0];\n newDst[9] = s * m[2 * 4 + 1];\n newDst[10] = s * m[2 * 4 + 2];\n newDst[11] = s * m[2 * 4 + 3];\n if (m !== newDst) {\n newDst[12] = m[12];\n newDst[13] = m[13];\n newDst[14] = m[14];\n newDst[15] = m[15];\n }\n return newDst;\n }\n return {\n create,\n set,\n fromMat3,\n fromQuat,\n negate,\n copy,\n clone,\n equalsApproximately,\n equals,\n identity,\n transpose,\n inverse,\n determinant,\n invert,\n multiply,\n mul,\n setTranslation,\n getTranslation,\n getAxis,\n setAxis,\n getScaling,\n perspective,\n perspectiveReverseZ,\n ortho,\n frustum,\n frustumReverseZ,\n aim,\n cameraAim,\n lookAt,\n translation,\n translate,\n rotationX,\n rotateX,\n rotationY,\n rotateY,\n rotationZ,\n rotateZ,\n axisRotation,\n rotation,\n axisRotate,\n rotate,\n scaling,\n scale,\n uniformScaling,\n uniformScale,\n };\n}\nconst cache$2 = new Map();\nfunction getAPI$2(Ctor) {\n let api = cache$2.get(Ctor);\n if (!api) {\n api = getAPIImpl$2(Ctor);\n cache$2.set(Ctor, api);\n }\n return api;\n}\n\n/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n * Generates am typed API for Qud\n * */\nfunction getAPIImpl$1(Ctor) {\n const vec3 = getAPI$4(Ctor);\n /**\n * Creates a quat4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\n function create(x, y, z, w) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n }\n /**\n * Creates a Quat; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\n const fromValues = create;\n /**\n * Sets the values of a Quat\n * Also see {@link quat.create} and {@link quat.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\n function set(x, y, z, w, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n return newDst;\n }\n /**\n * Sets a quaternion from the given angle and axis,\n * then returns it.\n *\n * @param axis - the axis to rotate around\n * @param angleInRadians - the angle\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The quaternion that represents the given axis and angle\n **/\n function fromAxisAngle(axis, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(4));\n const halfAngle = angleInRadians * 0.5;\n const s = Math.sin(halfAngle);\n newDst[0] = s * axis[0];\n newDst[1] = s * axis[1];\n newDst[2] = s * axis[2];\n newDst[3] = Math.cos(halfAngle);\n return newDst;\n }\n /**\n * Gets the rotation axis and angle\n * @param q - quaternion to compute from\n * @param dst - Vec3 to hold result. If not passed in a new one is created.\n * @return angle and axis\n */\n function toAxisAngle(q, dst) {\n const newDst = (dst ?? vec3.create(3));\n const angle = Math.acos(q[3]) * 2;\n const s = Math.sin(angle * 0.5);\n if (s > EPSILON) {\n newDst[0] = q[0] / s;\n newDst[1] = q[1] / s;\n newDst[2] = q[2] / s;\n }\n else {\n newDst[0] = 1;\n newDst[1] = 0;\n newDst[2] = 0;\n }\n return { angle, axis: newDst };\n }\n /**\n * Returns the angle in degrees between two rotations a and b.\n * @param a - quaternion a\n * @param b - quaternion b\n * @return angle in radians between the two quaternions\n */\n function angle(a, b) {\n const d = dot(a, b);\n return Math.acos(2 * d * d - 1);\n }\n /**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\n function multiply(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n const bx = b[0];\n const by = b[1];\n const bz = b[2];\n const bw = b[3];\n newDst[0] = ax * bw + aw * bx + ay * bz - az * by;\n newDst[1] = ay * bw + aw * by + az * bx - ax * bz;\n newDst[2] = az * bw + aw * bz + ax * by - ay * bx;\n newDst[3] = aw * bw - ax * bx - ay * by - az * bz;\n return newDst;\n }\n /**\n * Multiplies two quaternions\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\n const mul = multiply;\n /**\n * Rotates the given quaternion around the X axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\n function rotateX(q, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(4));\n const halfAngle = angleInRadians * 0.5;\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const bx = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n newDst[0] = qx * bw + qw * bx;\n newDst[1] = qy * bw + qz * bx;\n newDst[2] = qz * bw - qy * bx;\n newDst[3] = qw * bw - qx * bx;\n return newDst;\n }\n /**\n * Rotates the given quaternion around the Y axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\n function rotateY(q, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(4));\n const halfAngle = angleInRadians * 0.5;\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const by = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n newDst[0] = qx * bw - qz * by;\n newDst[1] = qy * bw + qw * by;\n newDst[2] = qz * bw + qx * by;\n newDst[3] = qw * bw - qy * by;\n return newDst;\n }\n /**\n * Rotates the given quaternion around the Z axis by the given angle.\n * @param q - quaternion to rotate\n * @param angleInRadians - The angle by which to rotate\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\n function rotateZ(q, angleInRadians, dst) {\n const newDst = (dst ?? new Ctor(4));\n const halfAngle = angleInRadians * 0.5;\n const qx = q[0];\n const qy = q[1];\n const qz = q[2];\n const qw = q[3];\n const bz = Math.sin(halfAngle);\n const bw = Math.cos(halfAngle);\n newDst[0] = qx * bw + qy * bz;\n newDst[1] = qy * bw - qx * bz;\n newDst[2] = qz * bw + qw * bz;\n newDst[3] = qw * bw - qz * bz;\n return newDst;\n }\n /**\n * Spherically linear interpolate between two quaternions\n *\n * @param a - starting value\n * @param b - ending value\n * @param t - value where 0 = a and 1 = b\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the result of a * b\n */\n function slerp(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(4));\n const ax = a[0];\n const ay = a[1];\n const az = a[2];\n const aw = a[3];\n let bx = b[0];\n let by = b[1];\n let bz = b[2];\n let bw = b[3];\n let cosOmega = ax * bx + ay * by + az * bz + aw * bw;\n if (cosOmega < 0) {\n cosOmega = -cosOmega;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n }\n let scale0;\n let scale1;\n if (1.0 - cosOmega > EPSILON) {\n const omega = Math.acos(cosOmega);\n const sinOmega = Math.sin(omega);\n scale0 = Math.sin((1 - t) * omega) / sinOmega;\n scale1 = Math.sin(t * omega) / sinOmega;\n }\n else {\n scale0 = 1.0 - t;\n scale1 = t;\n }\n newDst[0] = scale0 * ax + scale1 * bx;\n newDst[1] = scale0 * ay + scale1 * by;\n newDst[2] = scale0 * az + scale1 * bz;\n newDst[3] = scale0 * aw + scale1 * bw;\n return newDst;\n }\n /**\n * Compute the inverse of a quaternion\n *\n * @param q - quaternion to compute the inverse of\n * @returns A quaternion that is the result of a * b\n */\n function inverse(q, dst) {\n const newDst = (dst ?? new Ctor(4));\n const a0 = q[0];\n const a1 = q[1];\n const a2 = q[2];\n const a3 = q[3];\n const dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n const invDot = dot ? 1 / dot : 0;\n newDst[0] = -a0 * invDot;\n newDst[1] = -a1 * invDot;\n newDst[2] = -a2 * invDot;\n newDst[3] = a3 * invDot;\n return newDst;\n }\n /**\n * Compute the conjugate of a quaternion\n * For quaternions with a magnitude of 1 (a unit quaternion)\n * this returns the same as the inverse but is faster to calculate.\n *\n * @param q - quaternion to compute the conjugate of.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The conjugate of q\n */\n function conjugate(q, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = -q[0];\n newDst[1] = -q[1];\n newDst[2] = -q[2];\n newDst[3] = q[3];\n return newDst;\n }\n /**\n * Creates a quaternion from the given rotation matrix.\n *\n * The created quaternion is not normalized.\n *\n * @param m - rotation matrix\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\n function fromMat(m, dst) {\n const newDst = (dst ?? new Ctor(4));\n /*\n 0 1 2\n 3 4 5\n 6 7 8\n \n 0 1 2\n 4 5 6\n 8 9 10\n */\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n const trace = m[0] + m[5] + m[10];\n if (trace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n const root = Math.sqrt(trace + 1); // 2w\n newDst[3] = 0.5 * root;\n const invRoot = 0.5 / root; // 1/(4w)\n newDst[0] = (m[6] - m[9]) * invRoot;\n newDst[1] = (m[8] - m[2]) * invRoot;\n newDst[2] = (m[1] - m[4]) * invRoot;\n }\n else {\n // |w| <= 1/2\n let i = 0;\n if (m[5] > m[0]) {\n i = 1;\n }\n if (m[10] > m[i * 4 + i]) {\n i = 2;\n }\n const j = (i + 1) % 3;\n const k = (i + 2) % 3;\n const root = Math.sqrt(m[i * 4 + i] - m[j * 4 + j] - m[k * 4 + k] + 1.0);\n newDst[i] = 0.5 * root;\n const invRoot = 0.5 / root;\n newDst[3] = (m[j * 4 + k] - m[k * 4 + j]) * invRoot;\n newDst[j] = (m[j * 4 + i] + m[i * 4 + j]) * invRoot;\n newDst[k] = (m[k * 4 + i] + m[i * 4 + k]) * invRoot;\n }\n return newDst;\n }\n /**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param xAngleInRadians - angle to rotate around X axis in radians.\n * @param yAngleInRadians - angle to rotate around Y axis in radians.\n * @param zAngleInRadians - angle to rotate around Z axis in radians.\n * @param order - order to apply euler angles\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion representing the same rotation as the euler angles applied in the given order\n */\n function fromEuler(xAngleInRadians, yAngleInRadians, zAngleInRadians, order, dst) {\n const newDst = (dst ?? new Ctor(4));\n const xHalfAngle = xAngleInRadians * 0.5;\n const yHalfAngle = yAngleInRadians * 0.5;\n const zHalfAngle = zAngleInRadians * 0.5;\n const sx = Math.sin(xHalfAngle);\n const cx = Math.cos(xHalfAngle);\n const sy = Math.sin(yHalfAngle);\n const cy = Math.cos(yHalfAngle);\n const sz = Math.sin(zHalfAngle);\n const cz = Math.cos(zHalfAngle);\n switch (order) {\n case 'xyz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n case 'xzy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n case 'yxz':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz - sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n case 'yzx':\n newDst[0] = sx * cy * cz + cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n case 'zxy':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz + sx * sy * cz;\n newDst[3] = cx * cy * cz - sx * sy * sz;\n break;\n case 'zyx':\n newDst[0] = sx * cy * cz - cx * sy * sz;\n newDst[1] = cx * sy * cz + sx * cy * sz;\n newDst[2] = cx * cy * sz - sx * sy * cz;\n newDst[3] = cx * cy * cz + sx * sy * sz;\n break;\n default:\n throw new Error(`Unknown rotation order: ${order}`);\n }\n return newDst;\n }\n /**\n * Copies a quaternion. (same as {@link quat.clone})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is a copy of q\n */\n function copy(q, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = q[0];\n newDst[1] = q[1];\n newDst[2] = q[2];\n newDst[3] = q[3];\n return newDst;\n }\n /**\n * Clones a quaternion. (same as {@link quat.copy})\n * Also see {@link quat.create} and {@link quat.set}\n * @param q - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A copy of q.\n */\n const clone = copy;\n /**\n * Adds two quaternions; assumes a and b have the same dimension.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the sum of a and b.\n */\n function add(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n return newDst;\n }\n /**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\n function subtract(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n return newDst;\n }\n /**\n * Subtracts two quaternions.\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns A quaternion that is the difference of a and b.\n */\n const sub = subtract;\n /**\n * Multiplies a quaternion by a scalar.\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\n function mulScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n return newDst;\n }\n /**\n * Multiplies a quaternion by a scalar. (same as mulScalar)\n * @param v - The quaternion.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\n const scale = mulScalar;\n /**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The scaled quaternion.\n */\n function divScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n return newDst;\n }\n /**\n * Computes the dot product of two quaternions\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns dot product\n */\n function dot(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n }\n /**\n * Performs linear interpolation on two quaternions.\n * Given quaternions a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @param t - Interpolation coefficient.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\n function lerp(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n return newDst;\n }\n /**\n * Computes the length of quaternion\n * @param v - quaternion.\n * @returns length of quaternion.\n */\n function length(v) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n }\n /**\n * Computes the length of quaternion (same as length)\n * @param v - quaternion.\n * @returns length of quaternion.\n */\n const len = length;\n /**\n * Computes the square of the length of quaternion\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\n function lengthSq(v) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n }\n /**\n * Computes the square of the length of quaternion (same as lengthSq)\n * @param v - quaternion.\n * @returns square of the length of quaternion.\n */\n const lenSq = lengthSq;\n /**\n * Divides a quaternion by its Euclidean length and returns the quotient.\n * @param v - The quaternion.\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns The normalized quaternion.\n */\n function normalize(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n }\n else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n }\n return newDst;\n }\n /**\n * Check if 2 quaternions are approximately equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are approximately equal\n */\n function equalsApproximately(a, b) {\n return Math.abs(a[0] - b[0]) < EPSILON &&\n Math.abs(a[1] - b[1]) < EPSILON &&\n Math.abs(a[2] - b[2]) < EPSILON &&\n Math.abs(a[3] - b[3]) < EPSILON;\n }\n /**\n * Check if 2 quaternions are exactly equal\n * @param a - Operand quaternion.\n * @param b - Operand quaternion.\n * @returns true if quaternions are exactly equal\n */\n function equals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Creates an identity quaternion\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns an identity quaternion\n */\n function identity(dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n return newDst;\n }\n const tempVec3 = vec3.create();\n const xUnitVec3 = vec3.create();\n const yUnitVec3 = vec3.create();\n /**\n * Computes a quaternion to represent the shortest rotation from one vector to another.\n *\n * @param aUnit - the start vector\n * @param bUnit - the end vector\n * @param dst - quaternion to hold result. If not passed in a new one is created.\n * @returns the result\n */\n function rotationTo(aUnit, bUnit, dst) {\n const newDst = (dst ?? new Ctor(4));\n const dot = vec3.dot(aUnit, bUnit);\n if (dot < -0.999999) {\n vec3.cross(xUnitVec3, aUnit, tempVec3);\n if (vec3.len(tempVec3) < 0.000001) {\n vec3.cross(yUnitVec3, aUnit, tempVec3);\n }\n vec3.normalize(tempVec3, tempVec3);\n fromAxisAngle(tempVec3, Math.PI, newDst);\n return newDst;\n }\n else if (dot > 0.999999) {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 1;\n return newDst;\n }\n else {\n vec3.cross(aUnit, bUnit, tempVec3);\n newDst[0] = tempVec3[0];\n newDst[1] = tempVec3[1];\n newDst[2] = tempVec3[2];\n newDst[3] = 1 + dot;\n return normalize(newDst, newDst);\n }\n }\n const tempQuat1 = new Ctor(4);\n const tempQuat2 = new Ctor(4);\n /**\n * Performs a spherical linear interpolation with two control points\n *\n * @param a - the first quaternion\n * @param b - the second quaternion\n * @param c - the third quaternion\n * @param d - the fourth quaternion\n * @param t - Interpolation coefficient 0 to 1\n * @returns result\n */\n function sqlerp(a, b, c, d, t, dst) {\n const newDst = (dst ?? new Ctor(4));\n slerp(a, d, t, tempQuat1);\n slerp(b, c, t, tempQuat2);\n slerp(tempQuat1, tempQuat2, 2 * t * (1 - t), newDst);\n return newDst;\n }\n return {\n create,\n fromValues,\n set,\n fromAxisAngle,\n toAxisAngle,\n angle,\n multiply,\n mul,\n rotateX,\n rotateY,\n rotateZ,\n slerp,\n inverse,\n conjugate,\n fromMat,\n fromEuler,\n copy,\n clone,\n add,\n subtract,\n sub,\n mulScalar,\n scale,\n divScalar,\n dot,\n lerp,\n length,\n len,\n lengthSq,\n lenSq,\n normalize,\n equalsApproximately,\n equals,\n identity,\n rotationTo,\n sqlerp,\n };\n}\nconst cache$1 = new Map();\n/**\n *\n * Quat4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Quat4`. In other words you can do this\n *\n * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = quat4.create();\n * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nfunction getAPI$1(Ctor) {\n let api = cache$1.get(Ctor);\n if (!api) {\n api = getAPIImpl$1(Ctor);\n cache$1.set(Ctor, api);\n }\n return api;\n}\n\n/*\n * Copyright 2022 Gregg Tavares\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n * Generates am typed API for Vec4\n * */\nfunction getAPIImpl(Ctor) {\n /**\n * Creates a vec4; may be called with x, y, z to set initial values.\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param w - Initial w value.\n * @returns the created vector\n */\n function create(x, y, z, w) {\n const newDst = new Ctor(4);\n if (x !== undefined) {\n newDst[0] = x;\n if (y !== undefined) {\n newDst[1] = y;\n if (z !== undefined) {\n newDst[2] = z;\n if (w !== undefined) {\n newDst[3] = w;\n }\n }\n }\n }\n return newDst;\n }\n /**\n * Creates a vec4; may be called with x, y, z to set initial values. (same as create)\n * @param x - Initial x value.\n * @param y - Initial y value.\n * @param z - Initial z value.\n * @param z - Initial w value.\n * @returns the created vector\n */\n const fromValues = create;\n /**\n * Sets the values of a Vec4\n * Also see {@link vec4.create} and {@link vec4.copy}\n *\n * @param x first value\n * @param y second value\n * @param z third value\n * @param w fourth value\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector with its elements set.\n */\n function set(x, y, z, w, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = x;\n newDst[1] = y;\n newDst[2] = z;\n newDst[3] = w;\n return newDst;\n }\n /**\n * Applies Math.ceil to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the ceil of each element of v.\n */\n function ceil(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = Math.ceil(v[0]);\n newDst[1] = Math.ceil(v[1]);\n newDst[2] = Math.ceil(v[2]);\n newDst[3] = Math.ceil(v[3]);\n return newDst;\n }\n /**\n * Applies Math.floor to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the floor of each element of v.\n */\n function floor(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = Math.floor(v[0]);\n newDst[1] = Math.floor(v[1]);\n newDst[2] = Math.floor(v[2]);\n newDst[3] = Math.floor(v[3]);\n return newDst;\n }\n /**\n * Applies Math.round to each element of vector\n * @param v - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the round of each element of v.\n */\n function round(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = Math.round(v[0]);\n newDst[1] = Math.round(v[1]);\n newDst[2] = Math.round(v[2]);\n newDst[3] = Math.round(v[3]);\n return newDst;\n }\n /**\n * Clamp each element of vector between min and max\n * @param v - Operand vector.\n * @param max - Min value, default 0\n * @param min - Max value, default 1\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that the clamped value of each element of v.\n */\n function clamp(v, min = 0, max = 1, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = Math.min(max, Math.max(min, v[0]));\n newDst[1] = Math.min(max, Math.max(min, v[1]));\n newDst[2] = Math.min(max, Math.max(min, v[2]));\n newDst[3] = Math.min(max, Math.max(min, v[3]));\n return newDst;\n }\n /**\n * Adds two vectors; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a and b.\n */\n function add(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] + b[0];\n newDst[1] = a[1] + b[1];\n newDst[2] = a[2] + b[2];\n newDst[3] = a[3] + b[3];\n return newDst;\n }\n /**\n * Adds two vectors, scaling the 2nd; assumes a and b have the same dimension.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param scale - Amount to scale b\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the sum of a + b * scale.\n */\n function addScaled(a, b, scale, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] + b[0] * scale;\n newDst[1] = a[1] + b[1] * scale;\n newDst[2] = a[2] + b[2] * scale;\n newDst[3] = a[3] + b[3] * scale;\n return newDst;\n }\n /**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\n function subtract(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] - b[0];\n newDst[1] = a[1] - b[1];\n newDst[2] = a[2] - b[2];\n newDst[3] = a[3] - b[3];\n return newDst;\n }\n /**\n * Subtracts two vectors.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A vector that is the difference of a and b.\n */\n const sub = subtract;\n /**\n * Check if 2 vectors are approximately equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are approximately equal\n */\n function equalsApproximately(a, b) {\n return Math.abs(a[0] - b[0]) < EPSILON &&\n Math.abs(a[1] - b[1]) < EPSILON &&\n Math.abs(a[2] - b[2]) < EPSILON &&\n Math.abs(a[3] - b[3]) < EPSILON;\n }\n /**\n * Check if 2 vectors are exactly equal\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns true if vectors are exactly equal\n */\n function equals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n }\n /**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficient.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The linear interpolated result.\n */\n function lerp(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] + t * (b[0] - a[0]);\n newDst[1] = a[1] + t * (b[1] - a[1]);\n newDst[2] = a[2] + t * (b[2] - a[2]);\n newDst[3] = a[3] + t * (b[3] - a[3]);\n return newDst;\n }\n /**\n * Performs linear interpolation on two vectors.\n * Given vectors a and b and interpolation coefficient vector t, returns\n * a + t * (b - a).\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param t - Interpolation coefficients vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns the linear interpolated result.\n */\n function lerpV(a, b, t, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] + t[0] * (b[0] - a[0]);\n newDst[1] = a[1] + t[1] * (b[1] - a[1]);\n newDst[2] = a[2] + t[2] * (b[2] - a[2]);\n newDst[3] = a[3] + t[3] * (b[3] - a[3]);\n return newDst;\n }\n /**\n * Return max values of two vectors.\n * Given vectors a and b returns\n * [max(a[0], b[0]), max(a[1], b[1]), max(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The max components vector.\n */\n function max(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = Math.max(a[0], b[0]);\n newDst[1] = Math.max(a[1], b[1]);\n newDst[2] = Math.max(a[2], b[2]);\n newDst[3] = Math.max(a[3], b[3]);\n return newDst;\n }\n /**\n * Return min values of two vectors.\n * Given vectors a and b returns\n * [min(a[0], b[0]), min(a[1], b[1]), min(a[2], b[2])].\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The min components vector.\n */\n function min(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = Math.min(a[0], b[0]);\n newDst[1] = Math.min(a[1], b[1]);\n newDst[2] = Math.min(a[2], b[2]);\n newDst[3] = Math.min(a[3], b[3]);\n return newDst;\n }\n /**\n * Multiplies a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n function mulScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = v[0] * k;\n newDst[1] = v[1] * k;\n newDst[2] = v[2] * k;\n newDst[3] = v[3] * k;\n return newDst;\n }\n /**\n * Multiplies a vector by a scalar. (same as mulScalar)\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n const scale = mulScalar;\n /**\n * Divides a vector by a scalar.\n * @param v - The vector.\n * @param k - The scalar.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The scaled vector.\n */\n function divScalar(v, k, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = v[0] / k;\n newDst[1] = v[1] / k;\n newDst[2] = v[2] / k;\n newDst[3] = v[3] / k;\n return newDst;\n }\n /**\n * Inverse a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\n function inverse(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = 1 / v[0];\n newDst[1] = 1 / v[1];\n newDst[2] = 1 / v[2];\n newDst[3] = 1 / v[3];\n return newDst;\n }\n /**\n * Invert a vector. (same as inverse)\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The inverted vector.\n */\n const invert = inverse;\n /**\n * Computes the dot product of two vectors\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @returns dot product\n */\n function dot(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]) + (a[3] * b[3]);\n }\n /**\n * Computes the length of vector\n * @param v - vector.\n * @returns length of vector.\n */\n function length(v) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n }\n /**\n * Computes the length of vector (same as length)\n * @param v - vector.\n * @returns length of vector.\n */\n const len = length;\n /**\n * Computes the square of the length of vector\n * @param v - vector.\n * @returns square of the length of vector.\n */\n function lengthSq(v) {\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n return v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;\n }\n /**\n * Computes the square of the length of vector (same as lengthSq)\n * @param v - vector.\n * @returns square of the length of vector.\n */\n const lenSq = lengthSq;\n /**\n * Computes the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\n function distance(a, b) {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n }\n /**\n * Computes the distance between 2 points (same as distance)\n * @param a - vector.\n * @param b - vector.\n * @returns distance between a and b\n */\n const dist = distance;\n /**\n * Computes the square of the distance between 2 points\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\n function distanceSq(a, b) {\n const dx = a[0] - b[0];\n const dy = a[1] - b[1];\n const dz = a[2] - b[2];\n const dw = a[3] - b[3];\n return dx * dx + dy * dy + dz * dz + dw * dw;\n }\n /**\n * Computes the square of the distance between 2 points (same as distanceSq)\n * @param a - vector.\n * @param b - vector.\n * @returns square of the distance between a and b\n */\n const distSq = distanceSq;\n /**\n * Divides a vector by its Euclidean length and returns the quotient.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The normalized vector.\n */\n function normalize(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n const v0 = v[0];\n const v1 = v[1];\n const v2 = v[2];\n const v3 = v[3];\n const len = Math.sqrt(v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3);\n if (len > 0.00001) {\n newDst[0] = v0 / len;\n newDst[1] = v1 / len;\n newDst[2] = v2 / len;\n newDst[3] = v3 / len;\n }\n else {\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n }\n return newDst;\n }\n /**\n * Negates a vector.\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns -v.\n */\n function negate(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = -v[0];\n newDst[1] = -v[1];\n newDst[2] = -v[2];\n newDst[3] = -v[3];\n return newDst;\n }\n /**\n * Copies a vector. (same as {@link vec4.clone})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\n function copy(v, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = v[0];\n newDst[1] = v[1];\n newDst[2] = v[2];\n newDst[3] = v[3];\n return newDst;\n }\n /**\n * Clones a vector. (same as {@link vec4.copy})\n * Also see {@link vec4.create} and {@link vec4.set}\n * @param v - The vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns A copy of v.\n */\n const clone = copy;\n /**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\n function multiply(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] * b[0];\n newDst[1] = a[1] * b[1];\n newDst[2] = a[2] * b[2];\n newDst[3] = a[3] * b[3];\n return newDst;\n }\n /**\n * Multiplies a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as mul)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of products of entries of a and b.\n */\n const mul = multiply;\n /**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length.\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\n function divide(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = a[0] / b[0];\n newDst[1] = a[1] / b[1];\n newDst[2] = a[2] / b[2];\n newDst[3] = a[3] / b[3];\n return newDst;\n }\n /**\n * Divides a vector by another vector (component-wise); assumes a and\n * b have the same length. (same as divide)\n * @param a - Operand vector.\n * @param b - Operand vector.\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The vector of quotients of entries of a and b.\n */\n const div = divide;\n /**\n * Zero's a vector\n * @param dst - vector to hold result. If not passed in a new one is created.\n * @returns The zeroed vector.\n */\n function zero(dst) {\n const newDst = (dst ?? new Ctor(4));\n newDst[0] = 0;\n newDst[1] = 0;\n newDst[2] = 0;\n newDst[3] = 0;\n return newDst;\n }\n /**\n * transform vec4 by 4x4 matrix\n * @param v - the vector\n * @param m - The matrix.\n * @param dst - optional vec4 to store result. If not passed a new one is created.\n * @returns the transformed vector\n */\n function transformMat4(v, m, dst) {\n const newDst = (dst ?? new Ctor(4));\n const x = v[0];\n const y = v[1];\n const z = v[2];\n const w = v[3];\n newDst[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n newDst[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n newDst[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n newDst[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return newDst;\n }\n /**\n * Treat a 4D vector as a direction and set it's length\n *\n * @param a The vec4 to lengthen\n * @param len The length of the resulting vector\n * @returns The lengthened vector\n */\n function setLength(a, len, dst) {\n const newDst = (dst ?? new Ctor(4));\n normalize(a, newDst);\n return mulScalar(newDst, len, newDst);\n }\n /**\n * Ensure a vector is not longer than a max length\n *\n * @param a The vec4 to limit\n * @param maxLen The longest length of the resulting vector\n * @returns The vector, shortened to maxLen if it's too long\n */\n function truncate(a, maxLen, dst) {\n const newDst = (dst ?? new Ctor(4));\n if (length(a) > maxLen) {\n return setLength(a, maxLen, newDst);\n }\n return copy(a, newDst);\n }\n /**\n * Return the vector exactly between 2 endpoint vectors\n *\n * @param a Endpoint 1\n * @param b Endpoint 2\n * @returns The vector exactly residing between endpoints 1 and 2\n */\n function midpoint(a, b, dst) {\n const newDst = (dst ?? new Ctor(4));\n return lerp(a, b, 0.5, newDst);\n }\n return {\n create,\n fromValues,\n set,\n ceil,\n floor,\n round,\n clamp,\n add,\n addScaled,\n subtract,\n sub,\n equalsApproximately,\n equals,\n lerp,\n lerpV,\n max,\n min,\n mulScalar,\n scale,\n divScalar,\n inverse,\n invert,\n dot,\n length,\n len,\n lengthSq,\n lenSq,\n distance,\n dist,\n distanceSq,\n distSq,\n normalize,\n negate,\n copy,\n clone,\n multiply,\n mul,\n divide,\n div,\n zero,\n transformMat4,\n setLength,\n truncate,\n midpoint,\n };\n}\nconst cache = new Map();\n/**\n *\n * Vec4 math functions.\n *\n * Almost all functions take an optional `newDst` argument. If it is not passed in the\n * functions will create a new `Vec4`. In other words you can do this\n *\n * const v = vec4.cross(v1, v2); // Creates a new Vec4 with the cross product of v1 x v2.\n *\n * or\n *\n * const v = vec4.create();\n * vec4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v\n *\n * The first style is often easier but depending on where it's used it generates garbage where\n * as there is almost never allocation with the second style.\n *\n * It is always safe to pass any vector as the destination. So for example\n *\n * vec4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1\n *\n */\nfunction getAPI(Ctor) {\n let api = cache.get(Ctor);\n if (!api) {\n api = getAPIImpl(Ctor);\n cache.set(Ctor, api);\n }\n return api;\n}\n\n/**\n * Some docs\n * @namespace wgpu-matrix\n */\n/**\n * Generate wgpu-matrix API for type\n */\nfunction wgpuMatrixAPI(Mat3Ctor, Mat4Ctor, QuatCtor, Vec2Ctor, Vec3Ctor, Vec4Ctor) {\n return {\n /** @namespace mat3 */\n mat3: getAPI$3(Mat3Ctor),\n /** @namespace mat4 */\n mat4: getAPI$2(Mat4Ctor),\n /** @namespace quat */\n quat: getAPI$1(QuatCtor),\n /** @namespace vec2 */\n vec2: getAPI$5(Vec2Ctor),\n /** @namespace vec3 */\n vec3: getAPI$4(Vec3Ctor),\n /** @namespace vec4 */\n vec4: getAPI(Vec4Ctor),\n };\n}\nconst { \n/**\n * 3x3 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\nmat3, \n/**\n * 4x4 Matrix functions that default to returning `Float32Array`\n * @namespace\n */\nmat4, \n/**\n * Quaternion functions that default to returning `Float32Array`\n * @namespace\n */\nquat, \n/**\n * Vec2 functions that default to returning `Float32Array`\n * @namespace\n */\nvec2, \n/**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\nvec3, \n/**\n * Vec3 functions that default to returning `Float32Array`\n * @namespace\n */\nvec4, } = wgpuMatrixAPI(Float32Array, Float32Array, Float32Array, Float32Array, Float32Array, Float32Array);\nconst { \n/**\n * 3x3 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\nmat3: mat3d, \n/**\n * 4x4 Matrix functions that default to returning `Float64Array`\n * @namespace\n */\nmat4: mat4d, \n/**\n * Quaternion functions that default to returning `Float64Array`\n * @namespace\n */\nquat: quatd, \n/**\n * Vec2 functions that default to returning `Float64Array`\n * @namespace\n */\nvec2: vec2d, \n/**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\nvec3: vec3d, \n/**\n * Vec3 functions that default to returning `Float64Array`\n * @namespace\n */\nvec4: vec4d, } = wgpuMatrixAPI(Float64Array, Float64Array, Float64Array, Float64Array, Float64Array, Float64Array);\nconst { \n/**\n * 3x3 Matrix functions that default to returning `number[]`\n * @namespace\n */\nmat3: mat3n, \n/**\n * 4x4 Matrix functions that default to returning `number[]`\n * @namespace\n */\nmat4: mat4n, \n/**\n * Quaternion functions that default to returning `number[]`\n * @namespace\n */\nquat: quatn, \n/**\n * Vec2 functions that default to returning `number[]`\n * @namespace\n */\nvec2: vec2n, \n/**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\nvec3: vec3n, \n/**\n * Vec3 functions that default to returning `number[]`\n * @namespace\n */\nvec4: vec4n, } = wgpuMatrixAPI(ZeroArray, Array, Array, Array, Array, Array);\n\nexport { mat3, mat3d, mat3n, mat4, mat4d, mat4n, quat, quatd, quatn, utils, vec2, vec2d, vec2n, vec3, vec3d, vec3n, vec4, vec4d, vec4n };\n//# sourceMappingURL=wgpu-matrix.module.js.map\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction ___$insertStyle(css) {\n if (!css) {\n return;\n }\n if (typeof window === 'undefined') {\n return;\n }\n\n var style = document.createElement('style');\n\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n document.head.appendChild(style);\n\n return css;\n}\n\nfunction colorToString (color, forceCSSHex) {\n var colorFormat = color.__state.conversionName.toString();\n var r = Math.round(color.r);\n var g = Math.round(color.g);\n var b = Math.round(color.b);\n var a = color.a;\n var h = Math.round(color.h);\n var s = color.s.toFixed(1);\n var v = color.v.toFixed(1);\n if (forceCSSHex || colorFormat === 'THREE_CHAR_HEX' || colorFormat === 'SIX_CHAR_HEX') {\n var str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n return 'unknown format';\n}\n\nvar ARR_EACH = Array.prototype.forEach;\nvar ARR_SLICE = Array.prototype.slice;\nvar Common = {\n BREAK: {},\n extend: function extend(target) {\n this.each(ARR_SLICE.call(arguments, 1), function (obj) {\n var keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function (key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n return target;\n },\n defaults: function defaults(target) {\n this.each(ARR_SLICE.call(arguments, 1), function (obj) {\n var keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function (key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n return target;\n },\n compose: function compose() {\n var toCall = ARR_SLICE.call(arguments);\n return function () {\n var args = ARR_SLICE.call(arguments);\n for (var i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n each: function each(obj, itr, scope) {\n if (!obj) {\n return;\n }\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) {\n var key = void 0;\n var l = void 0;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (var _key in obj) {\n if (itr.call(scope, obj[_key], _key) === this.BREAK) {\n return;\n }\n }\n }\n },\n defer: function defer(fnc) {\n setTimeout(fnc, 0);\n },\n debounce: function debounce(func, threshold, callImmediately) {\n var timeout = void 0;\n return function () {\n var obj = this;\n var args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n var callNow = callImmediately || !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n toArray: function toArray(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n isUndefined: function isUndefined(obj) {\n return obj === undefined;\n },\n isNull: function isNull(obj) {\n return obj === null;\n },\n isNaN: function (_isNaN) {\n function isNaN(_x) {\n return _isNaN.apply(this, arguments);\n }\n isNaN.toString = function () {\n return _isNaN.toString();\n };\n return isNaN;\n }(function (obj) {\n return isNaN(obj);\n }),\n isArray: Array.isArray || function (obj) {\n return obj.constructor === Array;\n },\n isObject: function isObject(obj) {\n return obj === Object(obj);\n },\n isNumber: function isNumber(obj) {\n return obj === obj + 0;\n },\n isString: function isString(obj) {\n return obj === obj + '';\n },\n isBoolean: function isBoolean(obj) {\n return obj === false || obj === true;\n },\n isFunction: function isFunction(obj) {\n return obj instanceof Function;\n }\n};\n\nvar INTERPRETATIONS = [\n{\n litmus: Common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function read(original) {\n var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString() + test[1].toString() + test[2].toString() + test[2].toString() + test[3].toString() + test[3].toString(), 0)\n };\n },\n write: colorToString\n },\n SIX_CHAR_HEX: {\n read: function read(original) {\n var test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 0)\n };\n },\n write: colorToString\n },\n CSS_RGB: {\n read: function read(original) {\n var test = original.match(/^rgb\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n write: colorToString\n },\n CSS_RGBA: {\n read: function read(original) {\n var test = original.match(/^rgba\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*,\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n write: colorToString\n }\n }\n},\n{\n litmus: Common.isNumber,\n conversions: {\n HEX: {\n read: function read(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n write: function write(color) {\n return color.hex;\n }\n }\n }\n},\n{\n litmus: Common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function read(original) {\n if (original.length !== 3) {\n return false;\n }\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n write: function write(color) {\n return [color.r, color.g, color.b];\n }\n },\n RGBA_ARRAY: {\n read: function read(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n write: function write(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n},\n{\n litmus: Common.isObject,\n conversions: {\n RGBA_OBJ: {\n read: function read(original) {\n if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b) && Common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n write: function write(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n RGB_OBJ: {\n read: function read(original) {\n if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n write: function write(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n HSVA_OBJ: {\n read: function read(original) {\n if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v) && Common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n write: function write(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n HSV_OBJ: {\n read: function read(original) {\n if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n write: function write(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n}];\nvar result = void 0;\nvar toReturn = void 0;\nvar interpret = function interpret() {\n toReturn = false;\n var original = arguments.length > 1 ? Common.toArray(arguments) : arguments[0];\n Common.each(INTERPRETATIONS, function (family) {\n if (family.litmus(original)) {\n Common.each(family.conversions, function (conversion, conversionName) {\n result = conversion.read(original);\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return Common.BREAK;\n }\n });\n return Common.BREAK;\n }\n });\n return toReturn;\n};\n\nvar tmpComponent = void 0;\nvar ColorMath = {\n hsv_to_rgb: function hsv_to_rgb(h, s, v) {\n var hi = Math.floor(h / 60) % 6;\n var f = h / 60 - Math.floor(h / 60);\n var p = v * (1.0 - s);\n var q = v * (1.0 - f * s);\n var t = v * (1.0 - (1.0 - f) * s);\n var c = [[v, t, p], [q, v, p], [p, v, t], [p, q, v], [t, p, v], [v, p, q]][hi];\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n rgb_to_hsv: function rgb_to_hsv(r, g, b) {\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var delta = max - min;\n var h = void 0;\n var s = void 0;\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n rgb_to_hex: function rgb_to_hex(r, g, b) {\n var hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n component_from_hex: function component_from_hex(hex, componentIndex) {\n return hex >> componentIndex * 8 & 0xFF;\n },\n hex_with_component: function hex_with_component(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | hex & ~(0xFF << tmpComponent);\n }\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\n\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar Color = function () {\n function Color() {\n classCallCheck(this, Color);\n this.__state = interpret.apply(this, arguments);\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n this.__state.a = this.__state.a || 1;\n }\n createClass(Color, [{\n key: 'toString',\n value: function toString() {\n return colorToString(this);\n }\n }, {\n key: 'toHexString',\n value: function toHexString() {\n return colorToString(this, true);\n }\n }, {\n key: 'toOriginal',\n value: function toOriginal() {\n return this.__state.conversion.write(this);\n }\n }]);\n return Color;\n}();\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function get$$1() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n Color.recalculateRGB(this, component, componentHexIndex);\n return this.__state[component];\n },\n set: function set$$1(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n this.__state[component] = v;\n }\n });\n}\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function get$$1() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n Color.recalculateHSV(this);\n return this.__state[component];\n },\n set: function set$$1(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n this.__state[component] = v;\n }\n });\n}\nColor.recalculateRGB = function (color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = ColorMath.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n Common.extend(color.__state, ColorMath.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\nColor.recalculateHSV = function (color) {\n var result = ColorMath.rgb_to_hsv(color.r, color.g, color.b);\n Common.extend(color.__state, {\n s: result.s,\n v: result.v\n });\n if (!Common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (Common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\nObject.defineProperty(Color.prototype, 'a', {\n get: function get$$1() {\n return this.__state.a;\n },\n set: function set$$1(v) {\n this.__state.a = v;\n }\n});\nObject.defineProperty(Color.prototype, 'hex', {\n get: function get$$1() {\n if (this.__state.space !== 'HEX') {\n this.__state.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b);\n this.__state.space = 'HEX';\n }\n return this.__state.hex;\n },\n set: function set$$1(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nvar Controller = function () {\n function Controller(object, property) {\n classCallCheck(this, Controller);\n this.initialValue = object[property];\n this.domElement = document.createElement('div');\n this.object = object;\n this.property = property;\n this.__onChange = undefined;\n this.__onFinishChange = undefined;\n }\n createClass(Controller, [{\n key: 'onChange',\n value: function onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n }, {\n key: 'onFinishChange',\n value: function onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n }, {\n key: 'setValue',\n value: function setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n this.updateDisplay();\n return this;\n }\n }, {\n key: 'getValue',\n value: function getValue() {\n return this.object[this.property];\n }\n }, {\n key: 'updateDisplay',\n value: function updateDisplay() {\n return this;\n }\n }, {\n key: 'isModified',\n value: function isModified() {\n return this.initialValue !== this.getValue();\n }\n }]);\n return Controller;\n}();\n\nvar EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\nvar EVENT_MAP_INV = {};\nCommon.each(EVENT_MAP, function (v, k) {\n Common.each(v, function (e) {\n EVENT_MAP_INV[e] = k;\n });\n});\nvar CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\nfunction cssValueToPixels(val) {\n if (val === '0' || Common.isUndefined(val)) {\n return 0;\n }\n var match = val.match(CSS_VALUE_PIXELS);\n if (!Common.isNull(match)) {\n return parseFloat(match[1]);\n }\n return 0;\n}\nvar dom = {\n makeSelectable: function makeSelectable(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n elem.onselectstart = selectable ? function () {\n return false;\n } : function () {};\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n makeFullscreen: function makeFullscreen(elem, hor, vert) {\n var vertical = vert;\n var horizontal = hor;\n if (Common.isUndefined(horizontal)) {\n horizontal = true;\n }\n if (Common.isUndefined(vertical)) {\n vertical = true;\n }\n elem.style.position = 'absolute';\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n fakeEvent: function fakeEvent(elem, eventType, pars, aux) {\n var params = pars || {};\n var className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n var evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n var clientX = params.x || params.clientX || 0;\n var clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false, params.cancelable || true, window, params.clickCount || 1, 0,\n 0,\n clientX,\n clientY,\n false, false, false, false, 0, null);\n break;\n }\n case 'KeyboardEvents':\n {\n var init = evt.initKeyboardEvent || evt.initKeyEvent;\n Common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false, params.cancelable, window, params.ctrlKey, params.altKey, params.shiftKey, params.metaKey, params.keyCode, params.charCode);\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n Common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n bind: function bind(elem, event, func, newBool) {\n var bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n unbind: function unbind(elem, event, func, newBool) {\n var bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n addClass: function addClass(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n var classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n removeClass: function removeClass(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n var classes = elem.className.split(/ +/);\n var index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n hasClass: function hasClass(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n getWidth: function getWidth(elem) {\n var style = getComputedStyle(elem);\n return cssValueToPixels(style['border-left-width']) + cssValueToPixels(style['border-right-width']) + cssValueToPixels(style['padding-left']) + cssValueToPixels(style['padding-right']) + cssValueToPixels(style.width);\n },\n getHeight: function getHeight(elem) {\n var style = getComputedStyle(elem);\n return cssValueToPixels(style['border-top-width']) + cssValueToPixels(style['border-bottom-width']) + cssValueToPixels(style['padding-top']) + cssValueToPixels(style['padding-bottom']) + cssValueToPixels(style.height);\n },\n getOffset: function getOffset(el) {\n var elem = el;\n var offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n isActive: function isActive(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n};\n\nvar BooleanController = function (_Controller) {\n inherits(BooleanController, _Controller);\n function BooleanController(object, property) {\n classCallCheck(this, BooleanController);\n var _this2 = possibleConstructorReturn(this, (BooleanController.__proto__ || Object.getPrototypeOf(BooleanController)).call(this, object, property));\n var _this = _this2;\n _this2.__prev = _this2.getValue();\n _this2.__checkbox = document.createElement('input');\n _this2.__checkbox.setAttribute('type', 'checkbox');\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n dom.bind(_this2.__checkbox, 'change', onChange, false);\n _this2.domElement.appendChild(_this2.__checkbox);\n _this2.updateDisplay();\n return _this2;\n }\n createClass(BooleanController, [{\n key: 'setValue',\n value: function setValue(v) {\n var toReturn = get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'setValue', this).call(this, v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n }, {\n key: 'updateDisplay',\n value: function updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n return get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'updateDisplay', this).call(this);\n }\n }]);\n return BooleanController;\n}(Controller);\n\nvar OptionController = function (_Controller) {\n inherits(OptionController, _Controller);\n function OptionController(object, property, opts) {\n classCallCheck(this, OptionController);\n var _this2 = possibleConstructorReturn(this, (OptionController.__proto__ || Object.getPrototypeOf(OptionController)).call(this, object, property));\n var options = opts;\n var _this = _this2;\n _this2.__select = document.createElement('select');\n if (Common.isArray(options)) {\n var map = {};\n Common.each(options, function (element) {\n map[element] = element;\n });\n options = map;\n }\n Common.each(options, function (value, key) {\n var opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n _this2.updateDisplay();\n dom.bind(_this2.__select, 'change', function () {\n var desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n _this2.domElement.appendChild(_this2.__select);\n return _this2;\n }\n createClass(OptionController, [{\n key: 'setValue',\n value: function setValue(v) {\n var toReturn = get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'setValue', this).call(this, v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n }, {\n key: 'updateDisplay',\n value: function updateDisplay() {\n if (dom.isActive(this.__select)) return this;\n this.__select.value = this.getValue();\n return get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'updateDisplay', this).call(this);\n }\n }]);\n return OptionController;\n}(Controller);\n\nvar StringController = function (_Controller) {\n inherits(StringController, _Controller);\n function StringController(object, property) {\n classCallCheck(this, StringController);\n var _this2 = possibleConstructorReturn(this, (StringController.__proto__ || Object.getPrototypeOf(StringController)).call(this, object, property));\n var _this = _this2;\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n _this2.__input = document.createElement('input');\n _this2.__input.setAttribute('type', 'text');\n dom.bind(_this2.__input, 'keyup', onChange);\n dom.bind(_this2.__input, 'change', onChange);\n dom.bind(_this2.__input, 'blur', onBlur);\n dom.bind(_this2.__input, 'keydown', function (e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n _this2.updateDisplay();\n _this2.domElement.appendChild(_this2.__input);\n return _this2;\n }\n createClass(StringController, [{\n key: 'updateDisplay',\n value: function updateDisplay() {\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return get(StringController.prototype.__proto__ || Object.getPrototypeOf(StringController.prototype), 'updateDisplay', this).call(this);\n }\n }]);\n return StringController;\n}(Controller);\n\nfunction numDecimals(x) {\n var _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n return 0;\n}\nvar NumberController = function (_Controller) {\n inherits(NumberController, _Controller);\n function NumberController(object, property, params) {\n classCallCheck(this, NumberController);\n var _this = possibleConstructorReturn(this, (NumberController.__proto__ || Object.getPrototypeOf(NumberController)).call(this, object, property));\n var _params = params || {};\n _this.__min = _params.min;\n _this.__max = _params.max;\n _this.__step = _params.step;\n if (Common.isUndefined(_this.__step)) {\n if (_this.initialValue === 0) {\n _this.__impliedStep = 1;\n } else {\n _this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(_this.initialValue)) / Math.LN10)) / 10;\n }\n } else {\n _this.__impliedStep = _this.__step;\n }\n _this.__precision = numDecimals(_this.__impliedStep);\n return _this;\n }\n createClass(NumberController, [{\n key: 'setValue',\n value: function setValue(v) {\n var _v = v;\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n return get(NumberController.prototype.__proto__ || Object.getPrototypeOf(NumberController.prototype), 'setValue', this).call(this, _v);\n }\n }, {\n key: 'min',\n value: function min(minValue) {\n this.__min = minValue;\n return this;\n }\n }, {\n key: 'max',\n value: function max(maxValue) {\n this.__max = maxValue;\n return this;\n }\n }, {\n key: 'step',\n value: function step(stepValue) {\n this.__step = stepValue;\n this.__impliedStep = stepValue;\n this.__precision = numDecimals(stepValue);\n return this;\n }\n }]);\n return NumberController;\n}(Controller);\n\nfunction roundToDecimal(value, decimals) {\n var tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n}\nvar NumberControllerBox = function (_NumberController) {\n inherits(NumberControllerBox, _NumberController);\n function NumberControllerBox(object, property, params) {\n classCallCheck(this, NumberControllerBox);\n var _this2 = possibleConstructorReturn(this, (NumberControllerBox.__proto__ || Object.getPrototypeOf(NumberControllerBox)).call(this, object, property, params));\n _this2.__truncationSuspended = false;\n var _this = _this2;\n var prevY = void 0;\n function onChange() {\n var attempted = parseFloat(_this.__input.value);\n if (!Common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n function onBlur() {\n onFinish();\n }\n function onMouseDrag(e) {\n var diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n prevY = e.clientY;\n }\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n _this2.__input = document.createElement('input');\n _this2.__input.setAttribute('type', 'text');\n dom.bind(_this2.__input, 'change', onChange);\n dom.bind(_this2.__input, 'blur', onBlur);\n dom.bind(_this2.__input, 'mousedown', onMouseDown);\n dom.bind(_this2.__input, 'keydown', function (e) {\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n _this2.updateDisplay();\n _this2.domElement.appendChild(_this2.__input);\n return _this2;\n }\n createClass(NumberControllerBox, [{\n key: 'updateDisplay',\n value: function updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this);\n }\n }]);\n return NumberControllerBox;\n}(NumberController);\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\nvar NumberControllerSlider = function (_NumberController) {\n inherits(NumberControllerSlider, _NumberController);\n function NumberControllerSlider(object, property, min, max, step) {\n classCallCheck(this, NumberControllerSlider);\n var _this2 = possibleConstructorReturn(this, (NumberControllerSlider.__proto__ || Object.getPrototypeOf(NumberControllerSlider)).call(this, object, property, { min: min, max: max, step: step }));\n var _this = _this2;\n _this2.__background = document.createElement('div');\n _this2.__foreground = document.createElement('div');\n dom.bind(_this2.__background, 'mousedown', onMouseDown);\n dom.bind(_this2.__background, 'touchstart', onTouchStart);\n dom.addClass(_this2.__background, 'slider');\n dom.addClass(_this2.__foreground, 'slider-fg');\n function onMouseDown(e) {\n document.activeElement.blur();\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n onMouseDrag(e);\n }\n function onMouseDrag(e) {\n e.preventDefault();\n var bgRect = _this.__background.getBoundingClientRect();\n _this.setValue(map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max));\n return false;\n }\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n function onTouchStart(e) {\n if (e.touches.length !== 1) {\n return;\n }\n dom.bind(window, 'touchmove', onTouchMove);\n dom.bind(window, 'touchend', onTouchEnd);\n onTouchMove(e);\n }\n function onTouchMove(e) {\n var clientX = e.touches[0].clientX;\n var bgRect = _this.__background.getBoundingClientRect();\n _this.setValue(map(clientX, bgRect.left, bgRect.right, _this.__min, _this.__max));\n }\n function onTouchEnd() {\n dom.unbind(window, 'touchmove', onTouchMove);\n dom.unbind(window, 'touchend', onTouchEnd);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n _this2.updateDisplay();\n _this2.__background.appendChild(_this2.__foreground);\n _this2.domElement.appendChild(_this2.__background);\n return _this2;\n }\n createClass(NumberControllerSlider, [{\n key: 'updateDisplay',\n value: function updateDisplay() {\n var pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this);\n }\n }]);\n return NumberControllerSlider;\n}(NumberController);\n\nvar FunctionController = function (_Controller) {\n inherits(FunctionController, _Controller);\n function FunctionController(object, property, text) {\n classCallCheck(this, FunctionController);\n var _this2 = possibleConstructorReturn(this, (FunctionController.__proto__ || Object.getPrototypeOf(FunctionController)).call(this, object, property));\n var _this = _this2;\n _this2.__button = document.createElement('div');\n _this2.__button.innerHTML = text === undefined ? 'Fire' : text;\n dom.bind(_this2.__button, 'click', function (e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n dom.addClass(_this2.__button, 'button');\n _this2.domElement.appendChild(_this2.__button);\n return _this2;\n }\n createClass(FunctionController, [{\n key: 'fire',\n value: function fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n }]);\n return FunctionController;\n}(Controller);\n\nvar ColorController = function (_Controller) {\n inherits(ColorController, _Controller);\n function ColorController(object, property) {\n classCallCheck(this, ColorController);\n var _this2 = possibleConstructorReturn(this, (ColorController.__proto__ || Object.getPrototypeOf(ColorController)).call(this, object, property));\n _this2.__color = new Color(_this2.getValue());\n _this2.__temp = new Color(0);\n var _this = _this2;\n _this2.domElement = document.createElement('div');\n dom.makeSelectable(_this2.domElement, false);\n _this2.__selector = document.createElement('div');\n _this2.__selector.className = 'selector';\n _this2.__saturation_field = document.createElement('div');\n _this2.__saturation_field.className = 'saturation-field';\n _this2.__field_knob = document.createElement('div');\n _this2.__field_knob.className = 'field-knob';\n _this2.__field_knob_border = '2px solid ';\n _this2.__hue_knob = document.createElement('div');\n _this2.__hue_knob.className = 'hue-knob';\n _this2.__hue_field = document.createElement('div');\n _this2.__hue_field.className = 'hue-field';\n _this2.__input = document.createElement('input');\n _this2.__input.type = 'text';\n _this2.__input_textShadow = '0 1px 1px ';\n dom.bind(_this2.__input, 'keydown', function (e) {\n if (e.keyCode === 13) {\n onBlur.call(this);\n }\n });\n dom.bind(_this2.__input, 'blur', onBlur);\n dom.bind(_this2.__selector, 'mousedown', function () {\n dom.addClass(this, 'drag').bind(window, 'mouseup', function () {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n dom.bind(_this2.__selector, 'touchstart', function () {\n dom.addClass(this, 'drag').bind(window, 'touchend', function () {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n var valueField = document.createElement('div');\n Common.extend(_this2.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n Common.extend(_this2.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: _this2.__field_knob_border + (_this2.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n Common.extend(_this2.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n Common.extend(_this2.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n Common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n Common.extend(_this2.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n hueGradient(_this2.__hue_field);\n Common.extend(_this2.__input.style, {\n outline: 'none',\n textAlign: 'center',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: _this2.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n dom.bind(_this2.__saturation_field, 'mousedown', fieldDown);\n dom.bind(_this2.__saturation_field, 'touchstart', fieldDown);\n dom.bind(_this2.__field_knob, 'mousedown', fieldDown);\n dom.bind(_this2.__field_knob, 'touchstart', fieldDown);\n dom.bind(_this2.__hue_field, 'mousedown', fieldDownH);\n dom.bind(_this2.__hue_field, 'touchstart', fieldDownH);\n function fieldDown(e) {\n setSV(e);\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'touchmove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n dom.bind(window, 'touchend', fieldUpSV);\n }\n function fieldDownH(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'touchmove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n dom.bind(window, 'touchend', fieldUpH);\n }\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'touchmove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n dom.unbind(window, 'touchend', fieldUpSV);\n onFinish();\n }\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'touchmove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n dom.unbind(window, 'touchend', fieldUpH);\n onFinish();\n }\n function onBlur() {\n var i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n _this2.__saturation_field.appendChild(valueField);\n _this2.__selector.appendChild(_this2.__field_knob);\n _this2.__selector.appendChild(_this2.__saturation_field);\n _this2.__selector.appendChild(_this2.__hue_field);\n _this2.__hue_field.appendChild(_this2.__hue_knob);\n _this2.domElement.appendChild(_this2.__input);\n _this2.domElement.appendChild(_this2.__selector);\n _this2.updateDisplay();\n function setSV(e) {\n if (e.type.indexOf('touch') === -1) {\n e.preventDefault();\n }\n var fieldRect = _this.__saturation_field.getBoundingClientRect();\n var _ref = e.touches && e.touches[0] || e,\n clientX = _ref.clientX,\n clientY = _ref.clientY;\n var s = (clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n var v = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n _this.__color.v = v;\n _this.__color.s = s;\n _this.setValue(_this.__color.toOriginal());\n return false;\n }\n function setH(e) {\n if (e.type.indexOf('touch') === -1) {\n e.preventDefault();\n }\n var fieldRect = _this.__hue_field.getBoundingClientRect();\n var _ref2 = e.touches && e.touches[0] || e,\n clientY = _ref2.clientY;\n var h = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n _this.__color.h = h * 360;\n _this.setValue(_this.__color.toOriginal());\n return false;\n }\n return _this2;\n }\n createClass(ColorController, [{\n key: 'updateDisplay',\n value: function updateDisplay() {\n var i = interpret(this.getValue());\n if (i !== false) {\n var mismatch = false;\n Common.each(Color.COMPONENTS, function (component) {\n if (!Common.isUndefined(i[component]) && !Common.isUndefined(this.__color.__state[component]) && i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {};\n }\n }, this);\n if (mismatch) {\n Common.extend(this.__color.__state, i);\n }\n }\n Common.extend(this.__temp.__state, this.__color.__state);\n this.__temp.a = 1;\n var flip = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0;\n var _flip = 255 - flip;\n Common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n this.__temp.s = 1;\n this.__temp.v = 1;\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n this.__input.value = this.__color.toString();\n Common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n }]);\n return ColorController;\n}(Controller);\nvar vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n Common.each(vendors, function (vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nvar css = {\n load: function load(url, indoc) {\n var doc = indoc || document;\n var link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n inject: function inject(cssContent, indoc) {\n var doc = indoc || document;\n var injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = cssContent;\n var head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) {\n }\n }\n};\n\nvar saveDialogContents = \"
\\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
\\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
\\n\\n
\\n\\n
\";\n\nvar ControllerFactory = function ControllerFactory(object, property) {\n var initialValue = object[property];\n if (Common.isArray(arguments[2]) || Common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n if (Common.isNumber(initialValue)) {\n if (Common.isNumber(arguments[2]) && Common.isNumber(arguments[3])) {\n if (Common.isNumber(arguments[4])) {\n return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]);\n }\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n if (Common.isNumber(arguments[4])) {\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3], step: arguments[4] });\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n if (Common.isString(initialValue)) {\n return new StringController(object, property);\n }\n if (Common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n if (Common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n return null;\n};\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\nvar requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame;\n\nvar CenteredDiv = function () {\n function CenteredDiv() {\n classCallCheck(this, CenteredDiv);\n this.backgroundElement = document.createElement('div');\n Common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n this.domElement = document.createElement('div');\n Common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n var _this = this;\n dom.bind(this.backgroundElement, 'click', function () {\n _this.hide();\n });\n }\n createClass(CenteredDiv, [{\n key: 'show',\n value: function show() {\n var _this = this;\n this.backgroundElement.style.display = 'block';\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n this.layout();\n Common.defer(function () {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n }, {\n key: 'hide',\n value: function hide() {\n var _this = this;\n var hide = function hide() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n this.backgroundElement.style.opacity = 0;\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n }, {\n key: 'layout',\n value: function layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n }]);\n return CenteredDiv;\n}();\n\nvar styleSheet = ___$insertStyle(\".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\\n\");\n\ncss.inject(styleSheet);\nvar CSS_NAMESPACE = 'dg';\nvar HIDE_KEY_CODE = 72;\nvar CLOSE_BUTTON_HEIGHT = 20;\nvar DEFAULT_DEFAULT_PRESET_NAME = 'Default';\nvar SUPPORTS_LOCAL_STORAGE = function () {\n try {\n return !!window.localStorage;\n } catch (e) {\n return false;\n }\n}();\nvar SAVE_DIALOGUE = void 0;\nvar autoPlaceVirgin = true;\nvar autoPlaceContainer = void 0;\nvar hide = false;\nvar hideableGuis = [];\nvar GUI = function GUI(pars) {\n var _this = this;\n var params = pars || {};\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n dom.addClass(this.domElement, CSS_NAMESPACE);\n this.__folders = {};\n this.__controllers = [];\n this.__rememberedObjects = [];\n this.__rememberedObjectIndecesToControllers = [];\n this.__listening = [];\n params = Common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n params = Common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n if (!Common.isUndefined(params.load)) {\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n if (Common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n params.resizable = Common.isUndefined(params.parent) && params.resizable;\n if (params.autoPlace && Common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n var useLocalStorage = SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n var saveToLocalStorage = void 0;\n var titleRow = void 0;\n Object.defineProperties(this,\n {\n parent: {\n get: function get$$1() {\n return params.parent;\n }\n },\n scrollable: {\n get: function get$$1() {\n return params.scrollable;\n }\n },\n autoPlace: {\n get: function get$$1() {\n return params.autoPlace;\n }\n },\n closeOnTop: {\n get: function get$$1() {\n return params.closeOnTop;\n }\n },\n preset: {\n get: function get$$1() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n return params.load.preset;\n },\n set: function set$$1(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n width: {\n get: function get$$1() {\n return params.width;\n },\n set: function set$$1(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n name: {\n get: function get$$1() {\n return params.name;\n },\n set: function set$$1(v) {\n params.name = v;\n if (titleRow) {\n titleRow.innerHTML = params.name;\n }\n }\n },\n closed: {\n get: function get$$1() {\n return params.closed;\n },\n set: function set$$1(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n this.onResize();\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n load: {\n get: function get$$1() {\n return params.load;\n }\n },\n useLocalStorage: {\n get: function get$$1() {\n return useLocalStorage;\n },\n set: function set$$1(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n });\n if (Common.isUndefined(params.parent)) {\n this.closed = params.closed || false;\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n var savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n dom.bind(this.__closeButton, 'click', function () {\n _this.closed = !_this.closed;\n });\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n var titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n titleRow = addRow(_this, titleRowName);\n var onClickTitle = function onClickTitle(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n if (!params.closed) {\n this.closed = false;\n }\n }\n if (params.autoPlace) {\n if (Common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n autoPlaceContainer.appendChild(this.domElement);\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n this.__resizeHandler = function () {\n _this.onResizeDebounced();\n };\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n if (params.resizable) {\n addResizeHandle(this);\n }\n saveToLocalStorage = function saveToLocalStorage() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n function resetWidth() {\n var root = _this.getRoot();\n root.width += 1;\n Common.defer(function () {\n root.width -= 1;\n });\n }\n if (!params.parent) {\n resetWidth();\n }\n};\nGUI.toggleHide = function () {\n hide = !hide;\n Common.each(hideableGuis, function (gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\nGUI._keydownHandler = function (e) {\n if (document.activeElement.type !== 'text' && (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\nCommon.extend(GUI.prototype,\n{\n add: function add(object, property) {\n return _add(this, object, property, {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n });\n },\n addColor: function addColor(object, property) {\n return _add(this, object, property, {\n color: true\n });\n },\n remove: function remove(controller) {\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n var _this = this;\n Common.defer(function () {\n _this.onResize();\n });\n },\n destroy: function destroy() {\n if (this.parent) {\n throw new Error('Only the root GUI should be removed with .destroy(). ' + 'For subfolders, use gui.removeFolder(folder) instead.');\n }\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n var _this = this;\n Common.each(this.__folders, function (subfolder) {\n _this.removeFolder(subfolder);\n });\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n removeListeners(this);\n },\n addFolder: function addFolder(name) {\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' + ' name \"' + name + '\"');\n }\n var newGuiParams = { name: name, parent: this };\n newGuiParams.autoPlace = this.autoPlace;\n if (this.load &&\n this.load.folders &&\n this.load.folders[name]) {\n newGuiParams.closed = this.load.folders[name].closed;\n newGuiParams.load = this.load.folders[name];\n }\n var gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n var li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n removeFolder: function removeFolder(folder) {\n this.__ul.removeChild(folder.domElement.parentElement);\n delete this.__folders[folder.name];\n if (this.load &&\n this.load.folders &&\n this.load.folders[folder.name]) {\n delete this.load.folders[folder.name];\n }\n removeListeners(folder);\n var _this = this;\n Common.each(folder.__folders, function (subfolder) {\n folder.removeFolder(subfolder);\n });\n Common.defer(function () {\n _this.onResize();\n });\n },\n open: function open() {\n this.closed = false;\n },\n close: function close() {\n this.closed = true;\n },\n hide: function hide() {\n this.domElement.style.display = 'none';\n },\n show: function show() {\n this.domElement.style.display = '';\n },\n onResize: function onResize() {\n var root = this.getRoot();\n if (root.scrollable) {\n var top = dom.getOffset(root.__ul).top;\n var h = 0;\n Common.each(root.__ul.childNodes, function (node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n if (root.__resize_handle) {\n Common.defer(function () {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n onResizeDebounced: Common.debounce(function () {\n this.onResize();\n }, 50),\n remember: function remember() {\n if (Common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogContents;\n }\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n var _this = this;\n Common.each(Array.prototype.slice.call(arguments), function (object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n if (this.autoPlace) {\n setWidth(this, this.width);\n }\n },\n getRoot: function getRoot() {\n var gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n getSaveObject: function getSaveObject() {\n var toReturn = this.load;\n toReturn.closed = this.closed;\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n toReturn.folders = {};\n Common.each(this.__folders, function (element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n return toReturn;\n },\n save: function save() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n saveAs: function saveAs(presetName) {\n if (!this.load.remembered) {\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n revert: function revert(gui) {\n Common.each(this.__controllers, function (controller) {\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n Common.each(this.__folders, function (folder) {\n folder.revert(folder);\n });\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n listen: function listen(controller) {\n var init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n updateDisplay: function updateDisplay() {\n Common.each(this.__controllers, function (controller) {\n controller.updateDisplay();\n });\n Common.each(this.__folders, function (folder) {\n folder.updateDisplay();\n });\n }\n});\nfunction addRow(gui, newDom, liBefore) {\n var li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\nfunction removeListeners(gui) {\n dom.unbind(window, 'resize', gui.__resizeHandler);\n if (gui.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', gui.saveToLocalStorageIfPossible);\n }\n}\nfunction markPresetModified(gui, modified) {\n var opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n Common.extend(controller, {\n options: function options(_options) {\n if (arguments.length > 1) {\n var nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n return _add(gui, controller.object, controller.property, {\n before: nextSibling,\n factoryArgs: [Common.toArray(arguments)]\n });\n }\n if (Common.isArray(_options) || Common.isObject(_options)) {\n var _nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n return _add(gui, controller.object, controller.property, {\n before: _nextSibling,\n factoryArgs: [_options]\n });\n }\n },\n name: function name(_name) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = _name;\n return controller;\n },\n listen: function listen() {\n controller.__gui.listen(controller);\n return controller;\n },\n remove: function remove() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n if (controller instanceof NumberControllerSlider) {\n var box = new NumberControllerBox(controller.object, controller.property, { min: controller.__min, max: controller.__max, step: controller.__step });\n Common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step', 'min', 'max'], function (method) {\n var pc = controller[method];\n var pb = box[method];\n controller[method] = box[method] = function () {\n var args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n var r = function r(returned) {\n if (Common.isNumber(controller.__min) && Common.isNumber(controller.__max)) {\n var oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n var wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n controller.remove();\n var newController = _add(gui, controller.object, controller.property, {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n newController.name(oldName);\n if (wasListening) newController.listen();\n return newController;\n }\n return returned;\n };\n controller.min = Common.compose(r, controller.min);\n controller.max = Common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function () {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n dom.bind(controller.__checkbox, 'click', function (e) {\n e.stopPropagation();\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function () {\n dom.fakeEvent(controller.__button, 'click');\n });\n dom.bind(li, 'mouseover', function () {\n dom.addClass(controller.__button, 'hover');\n });\n dom.bind(li, 'mouseout', function () {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = Common.compose(function (val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n controller.updateDisplay();\n }\n controller.setValue = Common.compose(function (val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n return val;\n }, controller.setValue);\n}\nfunction recallSavedValue(gui, controller) {\n var root = gui.getRoot();\n var matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n if (matchedIndex !== -1) {\n var controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] = controllerMap;\n }\n controllerMap[controller.property] = controller;\n if (root.load && root.load.remembered) {\n var presetMap = root.load.remembered;\n var preset = void 0;\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n return;\n }\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n var value = preset[matchedIndex][controller.property];\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\nfunction _add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error('Object \"' + object + '\" has no property \"' + property + '\"');\n }\n var controller = void 0;\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n var factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n recallSavedValue(gui, controller);\n dom.addClass(controller.domElement, 'c');\n var name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n var container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n var li = addRow(gui, container, params.before);\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, _typeof(controller.getValue()));\n }\n augmentController(gui, li, controller);\n gui.__controllers.push(controller);\n return controller;\n}\nfunction getLocalStorageHash(gui, key) {\n return document.location.href + '.' + key;\n}\nfunction addPresetOption(gui, name, setSelected) {\n var opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\nfunction addSaveMenu(gui) {\n var div = gui.__save_row = document.createElement('li');\n dom.addClass(gui.domElement, 'has-save');\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n dom.addClass(div, 'save-row');\n var gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n var button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n var button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n var button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n var select = gui.__preset_select = document.createElement('select');\n if (gui.load && gui.load.remembered) {\n Common.each(gui.load.remembered, function (value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n dom.bind(select, 'change', function () {\n for (var index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n gui.preset = this.value;\n });\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n if (SUPPORTS_LOCAL_STORAGE) {\n var explain = document.getElementById('dg-local-explain');\n var localStorageCheckBox = document.getElementById('dg-local-storage');\n var saveLocally = document.getElementById('dg-save-locally');\n saveLocally.style.display = 'block';\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n showHideExplain(gui, explain);\n dom.bind(localStorageCheckBox, 'change', function () {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n var newConstructorTextArea = document.getElementById('dg-new-constructor');\n dom.bind(newConstructorTextArea, 'keydown', function (e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n dom.bind(gears, 'click', function () {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n dom.bind(button, 'click', function () {\n gui.save();\n });\n dom.bind(button2, 'click', function () {\n var presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n dom.bind(button3, 'click', function () {\n gui.revert();\n });\n}\nfunction addResizeHandle(gui) {\n var pmouseX = void 0;\n gui.__resize_handle = document.createElement('div');\n Common.extend(gui.__resize_handle.style, {\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n });\n function drag(e) {\n e.preventDefault();\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n return false;\n }\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n function dragStart(e) {\n e.preventDefault();\n pmouseX = e.clientX;\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n return false;\n }\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\nfunction getCurrentPreset(gui, useInitialValues) {\n var toReturn = {};\n Common.each(gui.__rememberedObjects, function (val, index) {\n var savedValues = {};\n var controllerMap = gui.__rememberedObjectIndecesToControllers[index];\n Common.each(controllerMap, function (controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n toReturn[index] = savedValues;\n });\n return toReturn;\n}\nfunction setPresetSelectIndex(gui) {\n for (var index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame$1.call(window, function () {\n updateDisplays(controllerArray);\n });\n }\n Common.each(controllerArray, function (c) {\n c.updateDisplay();\n });\n}\n\nvar color = {\n Color: Color,\n math: ColorMath,\n interpret: interpret\n};\nvar controllers = {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n};\nvar dom$1 = { dom: dom };\nvar gui = { GUI: GUI };\nvar GUI$1 = GUI;\nvar index = {\n color: color,\n controllers: controllers,\n dom: dom$1,\n gui: gui,\n GUI: GUI$1\n};\n\nexport { color, controllers, dom$1 as dom, gui, GUI$1 as GUI };\nexport default index;\n//# sourceMappingURL=dat.gui.module.js.map\n","/** Shows an error dialog if getting an adapter wasn't successful. */\nexport function quitIfAdapterNotAvailable(\n adapter: GPUAdapter | null\n): asserts adapter {\n if (!('gpu' in navigator)) {\n fail('navigator.gpu is not defined - WebGPU not available in this browser');\n }\n\n if (!adapter) {\n fail(\"requestAdapter returned null - this sample can't run on this system\");\n }\n}\n\n/**\n * Shows an error dialog if getting a adapter or device wasn't successful,\n * or if/when the device is lost or has an uncaptured error.\n */\nexport function quitIfWebGPUNotAvailable(\n adapter: GPUAdapter | null,\n device: GPUDevice | null\n): asserts device {\n if (!device) {\n quitIfAdapterNotAvailable(adapter);\n fail('Unable to get a device for an unknown reason');\n return;\n }\n\n device.lost.then((reason) => {\n fail(`Device lost (\"${reason.reason}\"):\\n${reason.message}`);\n });\n device.onuncapturederror = (ev) => {\n fail(`Uncaptured error:\\n${ev.error.message}`);\n };\n}\n\n/** Fail by showing a console error, and dialog box if possible. */\nconst fail = (() => {\n type ErrorOutput = { show(msg: string): void };\n\n function createErrorOutput() {\n if (typeof document === 'undefined') {\n // Not implemented in workers.\n return {\n show(msg: string) {\n console.error(msg);\n },\n };\n }\n\n const dialogBox = document.createElement('dialog');\n dialogBox.close();\n document.body.append(dialogBox);\n\n const dialogText = document.createElement('pre');\n dialogText.style.whiteSpace = 'pre-wrap';\n dialogBox.append(dialogText);\n\n const closeBtn = document.createElement('button');\n closeBtn.textContent = 'OK';\n closeBtn.onclick = () => dialogBox.close();\n dialogBox.append(closeBtn);\n\n return {\n show(msg: string) {\n // Don't overwrite the dialog message while it's still open\n // (show the first error, not the most recent error).\n if (!dialogBox.open) {\n dialogText.textContent = msg;\n dialogBox.showModal();\n }\n },\n };\n }\n\n let output: ErrorOutput | undefined;\n\n return (message: string) => {\n if (!output) output = createErrorOutput();\n\n output.show(message);\n throw new Error(message);\n };\n})();\n","import { mat4 } from 'wgpu-matrix';\nimport { GUI } from 'dat.gui';\nimport { quitIfWebGPUNotAvailable } from '../util';\nimport texturedQuadWGSL from './texturedQuad.wgsl';\n\nconst adapter = await navigator.gpu?.requestAdapter();\nconst device = await adapter?.requestDevice();\nquitIfWebGPUNotAvailable(adapter, device);\n\n// creates a CSS hsl string from 3 normalized numbers (0 to 1)\nconst hsl = (hue: number, saturation: number, lightness: number) =>\n `hsl(${(hue * 360) | 0}, ${saturation * 100}%, ${(lightness * 100) | 0}%)`;\n\n// creates a CSS hsla string from 4 normalized numbers (0 to 1)\nconst hsla = (\n hue: number,\n saturation: number,\n lightness: number,\n alpha: number\n) =>\n // prettier-ignore\n `hsla(${(hue * 360) | 0}, ${saturation * 100}%, ${(lightness * 100) | 0}%, ${alpha})`;\n\n// Generates a canvas with 3 circles of different colors with blurred edges.\nfunction createSourceImage(size: number) {\n const canvas = document.createElement('canvas');\n canvas.width = size;\n canvas.height = size;\n const ctx = canvas.getContext('2d');\n ctx.translate(size / 2, size / 2);\n\n ctx.globalCompositeOperation = 'screen';\n const numCircles = 3;\n for (let i = 0; i < numCircles; ++i) {\n ctx.rotate((Math.PI * 2) / numCircles);\n ctx.save();\n ctx.translate(size / 6, 0);\n ctx.beginPath();\n\n const radius = size / 3;\n ctx.arc(0, 0, radius, 0, Math.PI * 2);\n\n const gradient = ctx.createRadialGradient(0, 0, radius / 2, 0, 0, radius);\n const h = i / numCircles;\n gradient.addColorStop(0.5, hsla(h, 1, 0.5, 1));\n gradient.addColorStop(1, hsla(h, 1, 0.5, 0));\n\n ctx.fillStyle = gradient;\n ctx.fill();\n ctx.restore();\n }\n return canvas;\n}\n\n// Generates a canvas with alternating colored and transparent stripes\nfunction createDestinationImage(size: number) {\n const canvas = document.createElement('canvas');\n canvas.width = size;\n canvas.height = size;\n const ctx = canvas.getContext('2d');\n\n const gradient = ctx.createLinearGradient(0, 0, size, size);\n for (let i = 0; i <= 6; ++i) {\n gradient.addColorStop(i / 6, hsl(i / -6, 1, 0.5));\n }\n\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, size, size);\n\n ctx.fillStyle = 'rgba(0, 0, 0, 255)';\n ctx.globalCompositeOperation = 'destination-out';\n ctx.rotate(Math.PI / -4);\n for (let i = 0; i < size * 2; i += 32) {\n ctx.fillRect(-size, i, size * 2, 16);\n }\n\n return canvas;\n}\n\n// make 2 canvas elements, 300x300 with images in them.\n// We'll copy these to textures.\nconst size = 300;\nconst srcCanvas = createSourceImage(size);\nconst dstCanvas = createDestinationImage(size);\n\n// Get a WebGPU context from the canvas and configure it\nconst canvas = document.querySelector('canvas');\nconst context = canvas.getContext('webgpu');\nconst devicePixelRatio = window.devicePixelRatio;\ncanvas.width = canvas.clientWidth * devicePixelRatio;\ncanvas.height = canvas.clientHeight * devicePixelRatio;\nconst presentationFormat = navigator.gpu.getPreferredCanvasFormat();\n\nconst module = device.createShaderModule({\n label: 'our hardcoded textured quad shaders',\n code: texturedQuadWGSL,\n});\n\nfunction createTextureFromSource(\n device: GPUDevice,\n source: HTMLCanvasElement,\n options: {\n flipY?: boolean;\n premultipliedAlpha?: boolean;\n } = {}\n) {\n const { flipY, premultipliedAlpha } = options;\n const texture = device.createTexture({\n format: 'rgba8unorm',\n size: [source.width, source.height],\n usage:\n GPUTextureUsage.TEXTURE_BINDING |\n GPUTextureUsage.COPY_DST |\n GPUTextureUsage.RENDER_ATTACHMENT,\n });\n device.queue.copyExternalImageToTexture(\n { source, flipY },\n { texture, premultipliedAlpha },\n { width: source.width, height: source.height }\n );\n return texture;\n}\n\nconst bindGroupLayout = device.createBindGroupLayout({\n entries: [\n { binding: 0, visibility: GPUShaderStage.FRAGMENT, sampler: {} },\n { binding: 1, visibility: GPUShaderStage.FRAGMENT, texture: {} },\n { binding: 2, visibility: GPUShaderStage.VERTEX, buffer: {} },\n ],\n});\n\nconst pipelineLayout = device.createPipelineLayout({\n bindGroupLayouts: [bindGroupLayout],\n});\n\n// create 2 textures with unpremultiplied alpha\nconst srcTextureUnpremultipliedAlpha = createTextureFromSource(\n device,\n srcCanvas\n);\nconst dstTextureUnpremultipliedAlpha = createTextureFromSource(\n device,\n dstCanvas\n);\n\n// create 2 textures with premultiplied alpha\nconst srcTexturePremultipliedAlpha = createTextureFromSource(\n device,\n srcCanvas,\n { premultipliedAlpha: true }\n);\nconst dstTexturePremultipliedAlpha = createTextureFromSource(\n device,\n dstCanvas,\n { premultipliedAlpha: true }\n);\n\nconst sampler = device.createSampler({\n magFilter: 'linear',\n minFilter: 'linear',\n mipmapFilter: 'linear',\n});\n\ntype Uniforms = {\n buffer: GPUBuffer;\n values: Float32Array;\n matrix: Float32Array;\n};\n\nfunction makeUniformBufferAndValues(device: GPUDevice): Uniforms {\n // offsets to the various uniform values in float32 indices\n const kMatrixOffset = 0;\n\n // create a buffer for the uniform values\n const uniformBufferSize = 16 * 4; // matrix is 16 32bit floats (4bytes each)\n const buffer = device.createBuffer({\n label: 'uniforms for quad',\n size: uniformBufferSize,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n });\n\n // create a typedarray to hold the values for the uniforms in JavaScript\n const values = new Float32Array(uniformBufferSize / 4);\n const matrix = values.subarray(kMatrixOffset, 16);\n return { buffer, values, matrix };\n}\nconst srcUniform = makeUniformBufferAndValues(device);\nconst dstUniform = makeUniformBufferAndValues(device);\n\nconst srcBindGroupUnpremultipliedAlpha = device.createBindGroup({\n layout: bindGroupLayout,\n entries: [\n { binding: 0, resource: sampler },\n { binding: 1, resource: srcTextureUnpremultipliedAlpha.createView() },\n { binding: 2, resource: { buffer: srcUniform.buffer } },\n ],\n});\n\nconst dstBindGroupUnpremultipliedAlpha = device.createBindGroup({\n layout: bindGroupLayout,\n entries: [\n { binding: 0, resource: sampler },\n { binding: 1, resource: dstTextureUnpremultipliedAlpha.createView() },\n { binding: 2, resource: { buffer: dstUniform.buffer } },\n ],\n});\n\nconst srcBindGroupPremultipliedAlpha = device.createBindGroup({\n layout: bindGroupLayout,\n entries: [\n { binding: 0, resource: sampler },\n { binding: 1, resource: srcTexturePremultipliedAlpha.createView() },\n { binding: 2, resource: { buffer: srcUniform.buffer } },\n ],\n});\n\nconst dstBindGroupPremultipliedAlpha = device.createBindGroup({\n layout: bindGroupLayout,\n entries: [\n { binding: 0, resource: sampler },\n { binding: 1, resource: dstTexturePremultipliedAlpha.createView() },\n { binding: 2, resource: { buffer: dstUniform.buffer } },\n ],\n});\n\nconst textureSets = [\n {\n srcTexture: srcTexturePremultipliedAlpha,\n dstTexture: dstTexturePremultipliedAlpha,\n srcBindGroup: srcBindGroupPremultipliedAlpha,\n dstBindGroup: dstBindGroupPremultipliedAlpha,\n },\n {\n srcTexture: srcTextureUnpremultipliedAlpha,\n dstTexture: dstTextureUnpremultipliedAlpha,\n srcBindGroup: srcBindGroupUnpremultipliedAlpha,\n dstBindGroup: dstBindGroupUnpremultipliedAlpha,\n },\n];\n\nconst clearValue = [0, 0, 0, 0];\nconst renderPassDescriptor: GPURenderPassDescriptor = {\n label: 'our basic canvas renderPass',\n colorAttachments: [\n {\n view: undefined, // <- to be filled out when we render\n clearValue,\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n};\n\nconst operations = ['add', 'subtract', 'reverse-subtract', 'min', 'max'];\n\nconst factors = [\n 'zero',\n 'one',\n 'src',\n 'one-minus-src',\n 'src-alpha',\n 'one-minus-src-alpha',\n 'dst',\n 'one-minus-dst',\n 'dst-alpha',\n 'one-minus-dst-alpha',\n 'src-alpha-saturated',\n 'constant',\n 'one-minus-constant',\n];\n\nconst presets: {\n [key: string]: { color?: GPUBlendComponent; alpha?: GPUBlendComponent };\n} = {\n 'default (copy)': {\n color: {\n operation: 'add',\n srcFactor: 'one',\n dstFactor: 'zero',\n },\n },\n 'premultiplied blend (source-over)': {\n color: {\n operation: 'add',\n srcFactor: 'one',\n dstFactor: 'one-minus-src-alpha',\n },\n },\n 'un-premultiplied blend': {\n color: {\n operation: 'add',\n srcFactor: 'src-alpha',\n dstFactor: 'one-minus-src-alpha',\n },\n },\n 'destination-over': {\n color: {\n operation: 'add',\n srcFactor: 'one-minus-dst-alpha',\n dstFactor: 'one',\n },\n },\n 'source-in': {\n color: {\n operation: 'add',\n srcFactor: 'dst-alpha',\n dstFactor: 'zero',\n },\n },\n 'destination-in': {\n color: {\n operation: 'add',\n srcFactor: 'zero',\n dstFactor: 'src-alpha',\n },\n },\n 'source-out': {\n color: {\n operation: 'add',\n srcFactor: 'one-minus-dst-alpha',\n dstFactor: 'zero',\n },\n },\n 'destination-out': {\n color: {\n operation: 'add',\n srcFactor: 'zero',\n dstFactor: 'one-minus-src-alpha',\n },\n },\n 'source-atop': {\n color: {\n operation: 'add',\n srcFactor: 'dst-alpha',\n dstFactor: 'one-minus-src-alpha',\n },\n },\n 'destination-atop': {\n color: {\n operation: 'add',\n srcFactor: 'one-minus-dst-alpha',\n dstFactor: 'src-alpha',\n },\n },\n 'additive (lighten)': {\n color: {\n operation: 'add',\n srcFactor: 'one',\n dstFactor: 'one',\n },\n },\n} as const;\n\nexport function keysOf(obj: {\n [k in T]: unknown;\n}): readonly T[] {\n return Object.keys(obj) as unknown[] as T[];\n}\nconst kPresets = keysOf(presets);\ntype Preset = (typeof kPresets)[number];\n\nconst color: GPUBlendComponent = {\n operation: 'add',\n srcFactor: 'one',\n dstFactor: 'one-minus-src',\n};\n\nconst alpha: GPUBlendComponent = {\n operation: 'add',\n srcFactor: 'one',\n dstFactor: 'one-minus-src',\n};\n\nconst constant = {\n color: [1, 0.5, 0.25],\n alpha: 1,\n};\n\nconst clear = {\n color: [0, 0, 0],\n alpha: 0,\n premultiply: true,\n};\n\nconst settings: {\n alphaMode: GPUCanvasAlphaMode;\n textureSet: string;\n preset: Preset;\n} = {\n alphaMode: 'premultiplied',\n textureSet: 'premultiplied alpha',\n preset: 'premultiplied blend (source-over)',\n};\n\n// Translates to/from a normalized color value and an 8bit unsigned color value.\n// This is because dat.gui only edits 8bit unsigned color values but we need normalized color values.\nclass GUIColorHelper {\n normalizedColor: number[];\n\n constructor(normalizedColor: number[]) {\n this.normalizedColor = normalizedColor;\n }\n get value() {\n return this.normalizedColor.map((v) => Math.round(v * 255));\n }\n set value(rgb255Color: number[]) {\n this.normalizedColor.forEach(\n (_, i) => (this.normalizedColor[i] = rgb255Color[i] / 255)\n );\n }\n}\n\nfunction applyPreset() {\n const preset = presets[settings.preset];\n Object.assign(color, preset.color);\n Object.assign(alpha, preset.alpha || preset.color);\n}\n\nconst gui = new GUI();\ngui\n .add(settings, 'alphaMode', ['opaque', 'premultiplied'])\n .name('canvas alphaMode')\n .onChange(render);\ngui\n .add(settings, 'textureSet', [\n 'premultiplied alpha',\n 'un-premultiplied alpha',\n ])\n .name('texture data')\n .onChange(render);\ngui.add(settings, 'preset', [...Object.keys(presets)]).onChange(() => {\n applyPreset();\n render();\n});\n\nconst colorFolder = gui.addFolder('color');\ncolorFolder.open();\ncolorFolder.add(color, 'operation', operations).onChange(render);\ncolorFolder.add(color, 'srcFactor', factors).onChange(render);\ncolorFolder.add(color, 'dstFactor', factors).onChange(render);\n\nconst alphaFolder = gui.addFolder('alpha');\nalphaFolder.open();\nalphaFolder.add(alpha, 'operation', operations).onChange(render);\nalphaFolder.add(alpha, 'srcFactor', factors).onChange(render);\nalphaFolder.add(alpha, 'dstFactor', factors).onChange(render);\n\nconst constantFolder = gui.addFolder('constant');\nconstantFolder.open();\nconstantFolder\n .addColor(new GUIColorHelper(constant.color), 'value')\n .name('color')\n .onChange(render);\nconstantFolder.add(constant, 'alpha', 0, 1).onChange(render);\n\nconst clearFolder = gui.addFolder('clear color');\nclearFolder.open();\nclearFolder.add(clear, 'premultiply').onChange(render);\nclearFolder.add(clear, 'alpha', 0, 1).onChange(render);\nclearFolder.addColor(new GUIColorHelper(clear.color), 'value').onChange(render);\n\nconst dstPipeline = device.createRenderPipeline({\n label: 'hardcoded textured quad pipeline',\n layout: pipelineLayout,\n vertex: {\n module,\n },\n fragment: {\n module,\n targets: [{ format: presentationFormat }],\n },\n});\n\nfunction makeBlendComponentValid(blend) {\n const { operation } = blend;\n if (operation === 'min' || operation === 'max') {\n blend.srcFactor = 'one';\n blend.dstFactor = 'one';\n }\n}\n\nfunction render() {\n makeBlendComponentValid(color);\n makeBlendComponentValid(alpha);\n gui.updateDisplay();\n\n const srcPipeline = device.createRenderPipeline({\n label: 'hardcoded textured quad pipeline',\n layout: pipelineLayout,\n vertex: {\n module,\n },\n fragment: {\n module,\n targets: [\n {\n format: presentationFormat,\n blend: {\n color,\n alpha,\n },\n },\n ],\n },\n });\n\n const { srcTexture, dstTexture, srcBindGroup, dstBindGroup } =\n textureSets[settings.textureSet === 'premultiplied alpha' ? 0 : 1];\n\n context.configure({\n device,\n format: presentationFormat,\n alphaMode: settings.alphaMode,\n });\n\n const canvasTexture = context.getCurrentTexture();\n // Get the current texture from the canvas context and\n // set it as the texture to render to.\n renderPassDescriptor.colorAttachments[0].view = canvasTexture.createView();\n\n // Apply the clearValue, pre-multiplying or not it based on the settings.\n {\n const { alpha, color, premultiply } = clear;\n const mult = premultiply ? alpha : 1;\n clearValue[0] = color[0] * mult;\n clearValue[1] = color[1] * mult;\n clearValue[2] = color[2] * mult;\n clearValue[3] = alpha;\n }\n\n function updateUniforms(\n uniforms: Uniforms,\n canvasTexture: GPUTexture,\n texture: GPUTexture\n ) {\n const projectionMatrix = mat4.ortho(\n 0,\n canvasTexture.width / devicePixelRatio,\n canvasTexture.height / devicePixelRatio,\n 0,\n -1,\n 1\n );\n\n mat4.scale(\n projectionMatrix,\n [texture.width, texture.height, 1],\n uniforms.matrix\n );\n\n // copy the values from JavaScript to the GPU\n device.queue.writeBuffer(uniforms.buffer, 0, uniforms.values);\n }\n updateUniforms(srcUniform, canvasTexture, srcTexture);\n updateUniforms(dstUniform, canvasTexture, dstTexture);\n\n const encoder = device.createCommandEncoder({\n label: 'render quad encoder',\n });\n const pass = encoder.beginRenderPass(renderPassDescriptor);\n\n // draw destination texture without blending\n pass.setPipeline(dstPipeline);\n pass.setBindGroup(0, dstBindGroup);\n pass.draw(6);\n\n // draw source texture with blending\n pass.setPipeline(srcPipeline);\n pass.setBindGroup(0, srcBindGroup);\n pass.setBlendConstant([...constant.color, constant.alpha]);\n pass.draw(6);\n\n pass.end();\n\n const commandBuffer = encoder.finish();\n device.queue.submit([commandBuffer]);\n}\n\napplyPreset();\nrender();\n"],"names":["GUI"],"mappings":"AAAA;AACA,SAAS,eAAe,CAAC,mBAAmB,EAAE,QAAQ,EAAE;AACxD,IAAI,OAAO,cAAc,mBAAmB,CAAC;AAC7C,QAAQ,WAAW,CAAC,GAAG,IAAI,EAAE;AAC7B,YAAY,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,YAAY,QAAQ,CAAC,IAAI,CAAC;AAC1B;AACA,KAAK,CAAC;AACN;AACA,MAAM,SAAS,GAAG,eAAe,EAAE,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,GAAG,QAAQ;;AAkFtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE;AAClC,QAAQ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;AAClC,QAAQ,IAAI,CAAC,KAAK,SAAS,EAAE;AAC7B,YAAY,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AACzB,YAAY,IAAI,CAAC,KAAK,SAAS,EAAE;AACjC,gBAAgB,MAAM,C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AC7B,IAAA,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC;AAClC,IAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;AAGZ,IAAA,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;AAC7B,IAAA,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC;AAClC,IAAA,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1D,IAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAEZ,IAAI,CAAC,GAAG,EAAE;AAEV,IAAA,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE;IACtC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC;AACtC;AAEA,WAAW,EAAE;AACb,MAAM,EAAE;;;;","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/sample/blending/main.ts b/sample/blending/main.ts new file mode 100644 index 00000000..17fce9cd --- /dev/null +++ b/sample/blending/main.ts @@ -0,0 +1,580 @@ +import { mat4 } from 'wgpu-matrix'; +import { GUI } from 'dat.gui'; +import { quitIfWebGPUNotAvailable } from '../util'; +import texturedQuadWGSL from './texturedQuad.wgsl'; + +const adapter = await navigator.gpu?.requestAdapter(); +const device = await adapter?.requestDevice(); +quitIfWebGPUNotAvailable(adapter, device); + +// creates a CSS hsl string from 3 normalized numbers (0 to 1) +const hsl = (hue: number, saturation: number, lightness: number) => + `hsl(${(hue * 360) | 0}, ${saturation * 100}%, ${(lightness * 100) | 0}%)`; + +// creates a CSS hsla string from 4 normalized numbers (0 to 1) +const hsla = ( + hue: number, + saturation: number, + lightness: number, + alpha: number +) => + // prettier-ignore + `hsla(${(hue * 360) | 0}, ${saturation * 100}%, ${(lightness * 100) | 0}%, ${alpha})`; + +// Generates a canvas with 3 circles of different colors with blurred edges. +function createSourceImage(size: number) { + const canvas = document.createElement('canvas'); + canvas.width = size; + canvas.height = size; + const ctx = canvas.getContext('2d'); + ctx.translate(size / 2, size / 2); + + ctx.globalCompositeOperation = 'screen'; + const numCircles = 3; + for (let i = 0; i < numCircles; ++i) { + ctx.rotate((Math.PI * 2) / numCircles); + ctx.save(); + ctx.translate(size / 6, 0); + ctx.beginPath(); + + const radius = size / 3; + ctx.arc(0, 0, radius, 0, Math.PI * 2); + + const gradient = ctx.createRadialGradient(0, 0, radius / 2, 0, 0, radius); + const h = i / numCircles; + gradient.addColorStop(0.5, hsla(h, 1, 0.5, 1)); + gradient.addColorStop(1, hsla(h, 1, 0.5, 0)); + + ctx.fillStyle = gradient; + ctx.fill(); + ctx.restore(); + } + return canvas; +} + +// Generates a canvas with alternating colored and transparent stripes +function createDestinationImage(size: number) { + const canvas = document.createElement('canvas'); + canvas.width = size; + canvas.height = size; + const ctx = canvas.getContext('2d'); + + const gradient = ctx.createLinearGradient(0, 0, size, size); + for (let i = 0; i <= 6; ++i) { + gradient.addColorStop(i / 6, hsl(i / -6, 1, 0.5)); + } + + ctx.fillStyle = gradient; + ctx.fillRect(0, 0, size, size); + + ctx.fillStyle = 'rgba(0, 0, 0, 255)'; + ctx.globalCompositeOperation = 'destination-out'; + ctx.rotate(Math.PI / -4); + for (let i = 0; i < size * 2; i += 32) { + ctx.fillRect(-size, i, size * 2, 16); + } + + return canvas; +} + +// make 2 canvas elements, 300x300 with images in them. +// We'll copy these to textures. +const size = 300; +const srcCanvas = createSourceImage(size); +const dstCanvas = createDestinationImage(size); + +// Get a WebGPU context from the canvas and configure it +const canvas = document.querySelector('canvas'); +const context = canvas.getContext('webgpu'); +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +const module = device.createShaderModule({ + label: 'our hardcoded textured quad shaders', + code: texturedQuadWGSL, +}); + +function createTextureFromSource( + device: GPUDevice, + source: HTMLCanvasElement, + options: { + flipY?: boolean; + premultipliedAlpha?: boolean; + } = {} +) { + const { flipY, premultipliedAlpha } = options; + const texture = device.createTexture({ + format: 'rgba8unorm', + size: [source.width, source.height], + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + { source, flipY }, + { texture, premultipliedAlpha }, + { width: source.width, height: source.height } + ); + return texture; +} + +const bindGroupLayout = device.createBindGroupLayout({ + entries: [ + { binding: 0, visibility: GPUShaderStage.FRAGMENT, sampler: {} }, + { binding: 1, visibility: GPUShaderStage.FRAGMENT, texture: {} }, + { binding: 2, visibility: GPUShaderStage.VERTEX, buffer: {} }, + ], +}); + +const pipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [bindGroupLayout], +}); + +// create 2 textures with unpremultiplied alpha +const srcTextureUnpremultipliedAlpha = createTextureFromSource( + device, + srcCanvas +); +const dstTextureUnpremultipliedAlpha = createTextureFromSource( + device, + dstCanvas +); + +// create 2 textures with premultiplied alpha +const srcTexturePremultipliedAlpha = createTextureFromSource( + device, + srcCanvas, + { premultipliedAlpha: true } +); +const dstTexturePremultipliedAlpha = createTextureFromSource( + device, + dstCanvas, + { premultipliedAlpha: true } +); + +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', + mipmapFilter: 'linear', +}); + +type Uniforms = { + buffer: GPUBuffer; + values: Float32Array; + matrix: Float32Array; +}; + +function makeUniformBufferAndValues(device: GPUDevice): Uniforms { + // offsets to the various uniform values in float32 indices + const kMatrixOffset = 0; + + // create a buffer for the uniform values + const uniformBufferSize = 16 * 4; // matrix is 16 32bit floats (4bytes each) + const buffer = device.createBuffer({ + label: 'uniforms for quad', + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + + // create a typedarray to hold the values for the uniforms in JavaScript + const values = new Float32Array(uniformBufferSize / 4); + const matrix = values.subarray(kMatrixOffset, 16); + return { buffer, values, matrix }; +} +const srcUniform = makeUniformBufferAndValues(device); +const dstUniform = makeUniformBufferAndValues(device); + +const srcBindGroupUnpremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: srcTextureUnpremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: srcUniform.buffer } }, + ], +}); + +const dstBindGroupUnpremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: dstTextureUnpremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: dstUniform.buffer } }, + ], +}); + +const srcBindGroupPremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: srcTexturePremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: srcUniform.buffer } }, + ], +}); + +const dstBindGroupPremultipliedAlpha = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { binding: 0, resource: sampler }, + { binding: 1, resource: dstTexturePremultipliedAlpha.createView() }, + { binding: 2, resource: { buffer: dstUniform.buffer } }, + ], +}); + +const textureSets = [ + { + srcTexture: srcTexturePremultipliedAlpha, + dstTexture: dstTexturePremultipliedAlpha, + srcBindGroup: srcBindGroupPremultipliedAlpha, + dstBindGroup: dstBindGroupPremultipliedAlpha, + }, + { + srcTexture: srcTextureUnpremultipliedAlpha, + dstTexture: dstTextureUnpremultipliedAlpha, + srcBindGroup: srcBindGroupUnpremultipliedAlpha, + dstBindGroup: dstBindGroupUnpremultipliedAlpha, + }, +]; + +const clearValue = [0, 0, 0, 0]; +const renderPassDescriptor: GPURenderPassDescriptor = { + label: 'our basic canvas renderPass', + colorAttachments: [ + { + view: undefined, // <- to be filled out when we render + clearValue, + loadOp: 'clear', + storeOp: 'store', + }, + ], +}; + +const operations = ['add', 'subtract', 'reverse-subtract', 'min', 'max']; + +const factors = [ + 'zero', + 'one', + 'src', + 'one-minus-src', + 'src-alpha', + 'one-minus-src-alpha', + 'dst', + 'one-minus-dst', + 'dst-alpha', + 'one-minus-dst-alpha', + 'src-alpha-saturated', + 'constant', + 'one-minus-constant', +]; + +const presets: { + [key: string]: { color?: GPUBlendComponent; alpha?: GPUBlendComponent }; +} = { + 'default (copy)': { + color: { + operation: 'add', + srcFactor: 'one', + dstFactor: 'zero', + }, + }, + 'premultiplied blend (source-over)': { + color: { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'un-premultiplied blend': { + color: { + operation: 'add', + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'destination-over': { + color: { + operation: 'add', + srcFactor: 'one-minus-dst-alpha', + dstFactor: 'one', + }, + }, + 'source-in': { + color: { + operation: 'add', + srcFactor: 'dst-alpha', + dstFactor: 'zero', + }, + }, + 'destination-in': { + color: { + operation: 'add', + srcFactor: 'zero', + dstFactor: 'src-alpha', + }, + }, + 'source-out': { + color: { + operation: 'add', + srcFactor: 'one-minus-dst-alpha', + dstFactor: 'zero', + }, + }, + 'destination-out': { + color: { + operation: 'add', + srcFactor: 'zero', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'source-atop': { + color: { + operation: 'add', + srcFactor: 'dst-alpha', + dstFactor: 'one-minus-src-alpha', + }, + }, + 'destination-atop': { + color: { + operation: 'add', + srcFactor: 'one-minus-dst-alpha', + dstFactor: 'src-alpha', + }, + }, + 'additive (lighten)': { + color: { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one', + }, + }, +} as const; + +export function keysOf(obj: { + [k in T]: unknown; +}): readonly T[] { + return Object.keys(obj) as unknown[] as T[]; +} +const kPresets = keysOf(presets); +type Preset = (typeof kPresets)[number]; + +const color: GPUBlendComponent = { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one-minus-src', +}; + +const alpha: GPUBlendComponent = { + operation: 'add', + srcFactor: 'one', + dstFactor: 'one-minus-src', +}; + +const constant = { + color: [1, 0.5, 0.25], + alpha: 1, +}; + +const clear = { + color: [0, 0, 0], + alpha: 0, + premultiply: true, +}; + +const settings: { + alphaMode: GPUCanvasAlphaMode; + textureSet: string; + preset: Preset; +} = { + alphaMode: 'premultiplied', + textureSet: 'premultiplied alpha', + preset: 'premultiplied blend (source-over)', +}; + +// Translates to/from a normalized color value and an 8bit unsigned color value. +// This is because dat.gui only edits 8bit unsigned color values but we need normalized color values. +class GUIColorHelper { + normalizedColor: number[]; + + constructor(normalizedColor: number[]) { + this.normalizedColor = normalizedColor; + } + get value() { + return this.normalizedColor.map((v) => Math.round(v * 255)); + } + set value(rgb255Color: number[]) { + this.normalizedColor.forEach( + (_, i) => (this.normalizedColor[i] = rgb255Color[i] / 255) + ); + } +} + +function applyPreset() { + const preset = presets[settings.preset]; + Object.assign(color, preset.color); + Object.assign(alpha, preset.alpha || preset.color); +} + +const gui = new GUI(); +gui + .add(settings, 'alphaMode', ['opaque', 'premultiplied']) + .name('canvas alphaMode') + .onChange(render); +gui + .add(settings, 'textureSet', [ + 'premultiplied alpha', + 'un-premultiplied alpha', + ]) + .name('texture data') + .onChange(render); +gui.add(settings, 'preset', [...Object.keys(presets)]).onChange(() => { + applyPreset(); + render(); +}); + +const colorFolder = gui.addFolder('color'); +colorFolder.open(); +colorFolder.add(color, 'operation', operations).onChange(render); +colorFolder.add(color, 'srcFactor', factors).onChange(render); +colorFolder.add(color, 'dstFactor', factors).onChange(render); + +const alphaFolder = gui.addFolder('alpha'); +alphaFolder.open(); +alphaFolder.add(alpha, 'operation', operations).onChange(render); +alphaFolder.add(alpha, 'srcFactor', factors).onChange(render); +alphaFolder.add(alpha, 'dstFactor', factors).onChange(render); + +const constantFolder = gui.addFolder('constant'); +constantFolder.open(); +constantFolder + .addColor(new GUIColorHelper(constant.color), 'value') + .name('color') + .onChange(render); +constantFolder.add(constant, 'alpha', 0, 1).onChange(render); + +const clearFolder = gui.addFolder('clear color'); +clearFolder.open(); +clearFolder.add(clear, 'premultiply').onChange(render); +clearFolder.add(clear, 'alpha', 0, 1).onChange(render); +clearFolder.addColor(new GUIColorHelper(clear.color), 'value').onChange(render); + +const dstPipeline = device.createRenderPipeline({ + label: 'hardcoded textured quad pipeline', + layout: pipelineLayout, + vertex: { + module, + }, + fragment: { + module, + targets: [{ format: presentationFormat }], + }, +}); + +function makeBlendComponentValid(blend) { + const { operation } = blend; + if (operation === 'min' || operation === 'max') { + blend.srcFactor = 'one'; + blend.dstFactor = 'one'; + } +} + +function render() { + makeBlendComponentValid(color); + makeBlendComponentValid(alpha); + gui.updateDisplay(); + + const srcPipeline = device.createRenderPipeline({ + label: 'hardcoded textured quad pipeline', + layout: pipelineLayout, + vertex: { + module, + }, + fragment: { + module, + targets: [ + { + format: presentationFormat, + blend: { + color, + alpha, + }, + }, + ], + }, + }); + + const { srcTexture, dstTexture, srcBindGroup, dstBindGroup } = + textureSets[settings.textureSet === 'premultiplied alpha' ? 0 : 1]; + + context.configure({ + device, + format: presentationFormat, + alphaMode: settings.alphaMode, + }); + + const canvasTexture = context.getCurrentTexture(); + // Get the current texture from the canvas context and + // set it as the texture to render to. + renderPassDescriptor.colorAttachments[0].view = canvasTexture.createView(); + + // Apply the clearValue, pre-multiplying or not it based on the settings. + { + const { alpha, color, premultiply } = clear; + const mult = premultiply ? alpha : 1; + clearValue[0] = color[0] * mult; + clearValue[1] = color[1] * mult; + clearValue[2] = color[2] * mult; + clearValue[3] = alpha; + } + + function updateUniforms( + uniforms: Uniforms, + canvasTexture: GPUTexture, + texture: GPUTexture + ) { + const projectionMatrix = mat4.ortho( + 0, + canvasTexture.width / devicePixelRatio, + canvasTexture.height / devicePixelRatio, + 0, + -1, + 1 + ); + + mat4.scale( + projectionMatrix, + [texture.width, texture.height, 1], + uniforms.matrix + ); + + // copy the values from JavaScript to the GPU + device.queue.writeBuffer(uniforms.buffer, 0, uniforms.values); + } + updateUniforms(srcUniform, canvasTexture, srcTexture); + updateUniforms(dstUniform, canvasTexture, dstTexture); + + const encoder = device.createCommandEncoder({ + label: 'render quad encoder', + }); + const pass = encoder.beginRenderPass(renderPassDescriptor); + + // draw destination texture without blending + pass.setPipeline(dstPipeline); + pass.setBindGroup(0, dstBindGroup); + pass.draw(6); + + // draw source texture with blending + pass.setPipeline(srcPipeline); + pass.setBindGroup(0, srcBindGroup); + pass.setBlendConstant([...constant.color, constant.alpha]); + pass.draw(6); + + pass.end(); + + const commandBuffer = encoder.finish(); + device.queue.submit([commandBuffer]); +} + +applyPreset(); +render(); diff --git a/sample/blending/meta.ts b/sample/blending/meta.ts new file mode 100644 index 00000000..771703e0 --- /dev/null +++ b/sample/blending/meta.ts @@ -0,0 +1,15 @@ +export default { + name: 'Blending', + description: ` + This example provides shows how to use blending in WebGPU. It draws a texture with diagonal lines + on top of a canvas with a CSS based checkerboard background. It then draws a texture with + 3 blurry circles on top the first texture with [blending settings](https://gpuweb.github.io/gpuweb/#color-target-state). + This lets you see both the effect of blending settings in WebGPU and the final result when composited on top of the canvas. + See [this article](https://webgpufundamentals.org/webgpu/lessons/webgpu-transparency.html) + for a more detailed explanation. + The presets are equivalent to the 2d canvas context's + [\`globalCompositingOperation\`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation). + `, + filename: __DIRNAME__, + sources: [{ path: 'main.ts' }, { path: 'texturedQuad.wgsl' }], +}; diff --git a/sample/blending/texturedQuad.wgsl b/sample/blending/texturedQuad.wgsl new file mode 100644 index 00000000..bf434bf5 --- /dev/null +++ b/sample/blending/texturedQuad.wgsl @@ -0,0 +1,39 @@ +struct OurVertexShaderOutput { + @builtin(position) position: vec4f, + @location(0) texcoord: vec2f, +}; + +struct Uniforms { + matrix: mat4x4f, +}; + +@group(0) @binding(2) var uni: Uniforms; + +@vertex fn vs( + @builtin(vertex_index) vertexIndex : u32 +) -> OurVertexShaderOutput { + let pos = array( + + vec2f( 0.0, 0.0), // center + vec2f( 1.0, 0.0), // right, center + vec2f( 0.0, 1.0), // center, top + + // 2st triangle + vec2f( 0.0, 1.0), // center, top + vec2f( 1.0, 0.0), // right, center + vec2f( 1.0, 1.0), // right, top + ); + + var vsOutput: OurVertexShaderOutput; + let xy = pos[vertexIndex]; + vsOutput.position = uni.matrix * vec4f(xy, 0.0, 1.0); + vsOutput.texcoord = xy; + return vsOutput; +} + +@group(0) @binding(0) var ourSampler: sampler; +@group(0) @binding(1) var ourTexture: texture_2d; + +@fragment fn fs(fsInput: OurVertexShaderOutput) -> @location(0) vec4f { + return textureSample(ourTexture, ourSampler, fsInput.texcoord); +} \ No newline at end of file diff --git a/samples/blending/index.html b/samples/blending/index.html new file mode 100644 index 00000000..552f89fe --- /dev/null +++ b/samples/blending/index.html @@ -0,0 +1,9 @@ + + + + + +