diff --git a/main.js b/main.js
index 77c47eb5..68273531 100644
--- a/main.js
+++ b/main.js
@@ -538,6 +538,20 @@ var texturedCube = {
],
};
+var timestampQuery = {
+ name: 'Timestamp Query',
+ description: 'This example shows how to use timestamp queries to measure render pass duration.',
+ filename: "sample/timestampQuery",
+ sources: [
+ { path: 'TimestampQueryManager.ts' },
+ { path: 'PerfCounter.ts' },
+ { path: 'main.ts' },
+ { path: '../../shaders/basic.vert.wgsl' },
+ { path: '../../shaders/black.frag.wgsl' },
+ { path: '../../meshes/cube.ts' },
+ ],
+};
+
var transparentCanvas = {
name: 'Transparent Cavnas',
description: 'This example shows use of a transparent WebGPU canvas.',
@@ -668,6 +682,7 @@ const pageCategories = [
occlusionQuery,
samplerParameters,
alphaToCoverage,
+ timestampQuery,
},
},
// 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..051bbd35 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/timestampQuery/PerfCounter.ts b/sample/timestampQuery/PerfCounter.ts
new file mode 100644
index 00000000..ec2f05de
--- /dev/null
+++ b/sample/timestampQuery/PerfCounter.ts
@@ -0,0 +1,29 @@
+// A minimalistic perf timer class that computes mean + stddev online
+export default class PerfCounter {
+ sampleCount: number;
+ accumulated: number;
+ accumulatedSq: number;
+
+ constructor() {
+ this.sampleCount = 0;
+ this.accumulated = 0;
+ this.accumulatedSq = 0;
+ }
+
+ addSample(value: number) {
+ this.sampleCount += 1;
+ this.accumulated += value;
+ this.accumulatedSq += value * value;
+ }
+
+ getAverage(): number {
+ return this.sampleCount === 0 ? 0 : this.accumulated / this.sampleCount;
+ }
+
+ getStddev(): number {
+ if (this.sampleCount === 0) return 0;
+ const avg = this.getAverage();
+ const variance = this.accumulatedSq / this.sampleCount - avg * avg;
+ return Math.sqrt(Math.max(0.0, variance));
+ }
+}
diff --git a/sample/timestampQuery/TimestampQueryManager.ts b/sample/timestampQuery/TimestampQueryManager.ts
new file mode 100644
index 00000000..46696418
--- /dev/null
+++ b/sample/timestampQuery/TimestampQueryManager.ts
@@ -0,0 +1,97 @@
+// Regroups all timestamp-related operations and resources.
+export default class TimestampQueryManager {
+ // The device may not support timestamp queries, on which case this whole
+ // class does nothing.
+ timestampSupported: boolean;
+
+ // Number of timestamp counters
+ timestampCount: number;
+
+ // The query objects. This is meant to be used in a ComputePassDescriptor's
+ // or RenderPassDescriptor's 'timestampWrites' field.
+ timestampQuerySet: GPUQuerySet;
+
+ // A buffer where to store query results
+ timestampBuffer: GPUBuffer;
+
+ // A buffer to map this result back to CPU
+ timestampMapBuffer: GPUBuffer;
+
+ // State used to avoid firing concurrent readback of timestamp values
+ hasOngoingTimestampReadback: boolean;
+
+ // Device must have the "timestamp-query" feature
+ constructor(device: GPUDevice, timestampCount: number) {
+ this.timestampSupported = device.features.has('timestamp-query');
+ if (!this.timestampSupported) return;
+
+ this.timestampCount = timestampCount;
+
+ // Create timestamp queries
+ this.timestampQuerySet = device.createQuerySet({
+ type: 'timestamp',
+ count: timestampCount, // begin and end
+ });
+
+ // Create a buffer where to store the result of GPU queries
+ const timestampByteSize = 8; // timestamps are uint64
+ const timestampBufferSize = timestampCount * timestampByteSize;
+ this.timestampBuffer = device.createBuffer({
+ size: timestampBufferSize,
+ usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.QUERY_RESOLVE,
+ });
+
+ // Create a buffer to map the result back to the CPU
+ this.timestampMapBuffer = device.createBuffer({
+ size: timestampBufferSize,
+ usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
+ });
+
+ this.hasOngoingTimestampReadback = false;
+ }
+
+ // Resolve all timestamp queries and copy the result into the map buffer
+ resolveAll(commandEncoder: GPUCommandEncoder) {
+ if (!this.timestampSupported) return;
+
+ // After the end of the measured render pass, we resolve queries into a
+ // dedicated buffer.
+ commandEncoder.resolveQuerySet(
+ this.timestampQuerySet,
+ 0 /* firstQuery */,
+ this.timestampCount /* queryCount */,
+ this.timestampBuffer,
+ 0 /* destinationOffset */
+ );
+
+ if (!this.hasOngoingTimestampReadback) {
+ // Copy values to the mapped buffer
+ commandEncoder.copyBufferToBuffer(
+ this.timestampBuffer,
+ 0,
+ this.timestampMapBuffer,
+ 0,
+ this.timestampBuffer.size
+ );
+ }
+ }
+
+ // Once resolved, we can read back the value of timestamps
+ readAsync(onTimestampReadBack: (timestamps: BigUint64Array) => void): void {
+ if (!this.timestampSupported) return;
+ if (this.hasOngoingTimestampReadback) return;
+
+ this.hasOngoingTimestampReadback = true;
+
+ const buffer = this.timestampMapBuffer;
+ void buffer.mapAsync(GPUMapMode.READ).then(() => {
+ const rawData = buffer.getMappedRange();
+ const timestamps = new BigUint64Array(rawData);
+
+ onTimestampReadBack(timestamps);
+
+ buffer.unmap();
+ this.hasOngoingTimestampReadback = false;
+ });
+ }
+}
diff --git a/sample/timestampQuery/index.html b/sample/timestampQuery/index.html
new file mode 100644
index 00000000..5094605f
--- /dev/null
+++ b/sample/timestampQuery/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+ webgpu-samples: timestampQuery
+
+
+
+
+
+
+
+
diff --git a/sample/timestampQuery/main.js b/sample/timestampQuery/main.js
new file mode 100644
index 00000000..85995b31
--- /dev/null
+++ b/sample/timestampQuery/main.js
@@ -0,0 +1,6184 @@
+/* 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);
+
+const cubeVertexSize = 4 * 10; // Byte size of one cube vertex.
+const cubePositionOffset = 0;
+const cubeUVOffset = 4 * 8;
+const cubeVertexCount = 36;
+// prettier-ignore
+const cubeVertexArray = new Float32Array([
+ // float4 position, float4 color, float2 uv,
+ 1, -1, 1, 1, 1, 0, 1, 1, 0, 1,
+ -1, -1, 1, 1, 0, 0, 1, 1, 1, 1,
+ -1, -1, -1, 1, 0, 0, 0, 1, 1, 0,
+ 1, -1, -1, 1, 1, 0, 0, 1, 0, 0,
+ 1, -1, 1, 1, 1, 0, 1, 1, 0, 1,
+ -1, -1, -1, 1, 0, 0, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
+ 1, -1, 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;
+
+struct VertexOutput {
+ @builtin(position) Position : vec4f,
+ @location(0) fragUV : vec2f,
+ @location(1) fragPosition: vec4f,
+}
+
+@vertex
+fn main(
+ @location(0) position : vec4f,
+ @location(1) uv : vec2f
+) -> VertexOutput {
+ var output : VertexOutput;
+ output.Position = uniforms.modelViewProjectionMatrix * position;
+ output.fragUV = uv;
+ output.fragPosition = 0.5 * (position + vec4(1.0, 1.0, 1.0, 1.0));
+ return output;
+}
+`;
+
+var fragmentWGSL = `@fragment
+fn main() -> @location(0) vec4f {
+ return vec4(0.0, 0.0, 0.0, 1.0);
+}`;
+
+/** 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);
+ };
+})();
+
+// A minimalistic perf timer class that computes mean + stddev online
+class PerfCounter {
+ sampleCount;
+ accumulated;
+ accumulatedSq;
+ constructor() {
+ this.sampleCount = 0;
+ this.accumulated = 0;
+ this.accumulatedSq = 0;
+ }
+ addSample(value) {
+ this.sampleCount += 1;
+ this.accumulated += value;
+ this.accumulatedSq += value * value;
+ }
+ getAverage() {
+ return this.sampleCount === 0 ? 0 : this.accumulated / this.sampleCount;
+ }
+ getStddev() {
+ if (this.sampleCount === 0)
+ return 0;
+ const avg = this.getAverage();
+ const variance = this.accumulatedSq / this.sampleCount - avg * avg;
+ return Math.sqrt(Math.max(0.0, variance));
+ }
+}
+
+// Regroups all timestamp-related operations and resources.
+class TimestampQueryManager {
+ // The device may not support timestamp queries, on which case this whole
+ // class does nothing.
+ timestampSupported;
+ // Number of timestamp counters
+ timestampCount;
+ // The query objects. This is meant to be used in a ComputePassDescriptor's
+ // or RenderPassDescriptor's 'timestampWrites' field.
+ timestampQuerySet;
+ // A buffer where to store query results
+ timestampBuffer;
+ // A buffer to map this result back to CPU
+ timestampMapBuffer;
+ // State used to avoid firing concurrent readback of timestamp values
+ hasOngoingTimestampReadback;
+ // Device must have the "timestamp-query" feature
+ constructor(device, timestampCount) {
+ this.timestampSupported = device.features.has('timestamp-query');
+ if (!this.timestampSupported)
+ return;
+ this.timestampCount = timestampCount;
+ // Create timestamp queries
+ this.timestampQuerySet = device.createQuerySet({
+ type: 'timestamp',
+ count: timestampCount, // begin and end
+ });
+ // Create a buffer where to store the result of GPU queries
+ const timestampByteSize = 8; // timestamps are uint64
+ const timestampBufferSize = timestampCount * timestampByteSize;
+ this.timestampBuffer = device.createBuffer({
+ size: timestampBufferSize,
+ usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.QUERY_RESOLVE,
+ });
+ // Create a buffer to map the result back to the CPU
+ this.timestampMapBuffer = device.createBuffer({
+ size: timestampBufferSize,
+ usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
+ });
+ this.hasOngoingTimestampReadback = false;
+ }
+ // Resolve all timestamp queries and copy the result into the map buffer
+ resolveAll(commandEncoder) {
+ if (!this.timestampSupported)
+ return;
+ // After the end of the measured render pass, we resolve queries into a
+ // dedicated buffer.
+ commandEncoder.resolveQuerySet(this.timestampQuerySet, 0 /* firstQuery */, this.timestampCount /* queryCount */, this.timestampBuffer, 0 /* destinationOffset */);
+ if (!this.hasOngoingTimestampReadback) {
+ // Copy values to the mapped buffer
+ commandEncoder.copyBufferToBuffer(this.timestampBuffer, 0, this.timestampMapBuffer, 0, this.timestampBuffer.size);
+ }
+ }
+ // Once resolved, we can read back the value of timestamps
+ readAsync(onTimestampReadBack) {
+ if (!this.timestampSupported)
+ return;
+ if (this.hasOngoingTimestampReadback)
+ return;
+ this.hasOngoingTimestampReadback = true;
+ const buffer = this.timestampMapBuffer;
+ void buffer.mapAsync(GPUMapMode.READ).then(() => {
+ const rawData = buffer.getMappedRange();
+ const timestamps = new BigUint64Array(rawData);
+ onTimestampReadBack(timestamps);
+ buffer.unmap();
+ this.hasOngoingTimestampReadback = false;
+ });
+ }
+}
+
+const canvas = document.querySelector('canvas');
+const adapter = await navigator.gpu?.requestAdapter();
+// The use of timestamps require a dedicated adapter feature:
+// The adapter may or may not support timestamp queries. If not, we simply
+// don't measure timestamps and deactivate the timer display.
+const supportsTimestampQueries = adapter?.features.has('timestamp-query');
+const device = await adapter?.requestDevice({
+ // We request a device that has support for timestamp queries
+ requiredFeatures: supportsTimestampQueries ? ['timestamp-query'] : [],
+});
+quitIfWebGPUNotAvailable(adapter, device);
+// GPU-side timer and the CPU-side counter where we accumulate statistics:
+// NB: Look for 'timestampQueryManager' in this file to locate parts of this
+// snippets that are related to timestamps. Most of the logic is in
+// TimestampQueryManager.ts.
+const timestampQueryManager = new TimestampQueryManager(device, 2);
+const renderPassDurationCounter = new PerfCounter();
+const context = canvas.getContext('webgpu');
+const devicePixelRatio = window.devicePixelRatio;
+canvas.width = canvas.clientWidth * devicePixelRatio;
+canvas.height = canvas.clientHeight * devicePixelRatio;
+const presentationFormat = navigator.gpu.getPreferredCanvasFormat();
+context.configure({
+ device,
+ format: presentationFormat,
+});
+// UI for perf counter
+const perfDisplayContainer = document.createElement('div');
+perfDisplayContainer.style.color = 'white';
+perfDisplayContainer.style.background = 'black';
+perfDisplayContainer.style.position = 'absolute';
+perfDisplayContainer.style.top = '10px';
+perfDisplayContainer.style.left = '10px';
+const perfDisplay = document.createElement('pre');
+perfDisplayContainer.appendChild(perfDisplay);
+if (canvas.parentNode) {
+ canvas.parentNode.appendChild(perfDisplayContainer);
+}
+else {
+ console.error('canvas.parentNode is null');
+}
+if (!supportsTimestampQueries) {
+ perfDisplay.innerHTML = 'Timestamp queries are not supported';
+}
+// Create a vertex buffer from the cube data.
+const verticesBuffer = device.createBuffer({
+ size: cubeVertexArray.byteLength,
+ usage: GPUBufferUsage.VERTEX,
+ mappedAtCreation: true,
+});
+new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray);
+verticesBuffer.unmap();
+const pipeline = device.createRenderPipeline({
+ layout: 'auto',
+ vertex: {
+ module: device.createShaderModule({
+ code: basicVertWGSL,
+ }),
+ buffers: [
+ {
+ arrayStride: cubeVertexSize,
+ attributes: [
+ {
+ // position
+ shaderLocation: 0,
+ offset: cubePositionOffset,
+ format: 'float32x4',
+ },
+ {
+ // uv
+ shaderLocation: 1,
+ offset: cubeUVOffset,
+ format: 'float32x2',
+ },
+ ],
+ },
+ ],
+ },
+ fragment: {
+ module: device.createShaderModule({
+ code: fragmentWGSL,
+ }),
+ targets: [
+ {
+ format: presentationFormat,
+ },
+ ],
+ },
+ primitive: {
+ topology: 'triangle-list',
+ // Backface culling since the cube is solid piece of geometry.
+ // Faces pointing away from the camera will be occluded by faces
+ // pointing toward the camera.
+ cullMode: 'back',
+ },
+ // Enable depth testing so that the fragment closest to the camera
+ // is rendered in front.
+ depthStencil: {
+ depthWriteEnabled: true,
+ depthCompare: 'less',
+ format: 'depth24plus',
+ },
+});
+const depthTexture = device.createTexture({
+ size: [canvas.width, canvas.height],
+ format: 'depth24plus',
+ usage: GPUTextureUsage.RENDER_ATTACHMENT,
+});
+const uniformBufferSize = 4 * 16; // 4x4 matrix
+const uniformBuffer = device.createBuffer({
+ size: uniformBufferSize,
+ usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
+});
+const uniformBindGroup = device.createBindGroup({
+ layout: pipeline.getBindGroupLayout(0),
+ entries: [
+ {
+ binding: 0,
+ resource: {
+ buffer: uniformBuffer,
+ },
+ },
+ ],
+});
+const renderPassDescriptor = {
+ colorAttachments: [
+ {
+ view: undefined, // Assigned later
+ clearValue: [0.95, 0.95, 0.95, 1.0],
+ loadOp: 'clear',
+ storeOp: 'store',
+ },
+ ],
+ depthStencilAttachment: {
+ view: depthTexture.createView(),
+ depthClearValue: 1.0,
+ depthLoadOp: 'clear',
+ depthStoreOp: 'store',
+ },
+ // We instruct the render pass to write to the timestamp query before/after
+ timestampWrites: {
+ querySet: timestampQueryManager.timestampQuerySet,
+ beginningOfPassWriteIndex: 0,
+ endOfPassWriteIndex: 1,
+ },
+};
+const aspect = canvas.width / canvas.height;
+const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0);
+const modelViewProjectionMatrix = mat4.create();
+function getTransformationMatrix() {
+ const viewMatrix = mat4.identity();
+ mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix);
+ const now = Date.now() / 1000;
+ mat4.rotate(viewMatrix, vec3.fromValues(Math.sin(now), Math.cos(now), 0), 1, viewMatrix);
+ mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix);
+ return modelViewProjectionMatrix;
+}
+function frame() {
+ const transformationMatrix = getTransformationMatrix();
+ device.queue.writeBuffer(uniformBuffer, 0, transformationMatrix.buffer, transformationMatrix.byteOffset, transformationMatrix.byteLength);
+ renderPassDescriptor.colorAttachments[0].view = context
+ .getCurrentTexture()
+ .createView();
+ const commandEncoder = device.createCommandEncoder();
+ const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
+ passEncoder.setPipeline(pipeline);
+ passEncoder.setBindGroup(0, uniformBindGroup);
+ passEncoder.setVertexBuffer(0, verticesBuffer);
+ passEncoder.draw(cubeVertexCount);
+ passEncoder.end();
+ // Resolve timestamp queries, so that their result is available in
+ // a GPU-sude buffer.
+ timestampQueryManager.resolveAll(commandEncoder);
+ device.queue.submit([commandEncoder.finish()]);
+ // Read timestamp value back from GPU buffers
+ timestampQueryManager.readAsync((timestamps) => {
+ // This may happen (see spec https://gpuweb.github.io/gpuweb/#timestamp)
+ if (timestamps[1] < timestamps[0])
+ return;
+ // Measure difference (in bigints)
+ const elapsedNs = timestamps[1] - timestamps[0];
+ // Cast into regular int (ok because value is small after difference)
+ // and convert from nanoseconds to milliseconds:
+ const elapsedMs = Number(elapsedNs) * 1e-6;
+ renderPassDurationCounter.addSample(elapsedMs);
+ console.log('timestamps (ms): elapsed', elapsedMs, 'avg', renderPassDurationCounter.getAverage());
+ perfDisplay.innerHTML = `Render Pass duration: ${renderPassDurationCounter
+ .getAverage()
+ .toFixed(3)} ms ± ${renderPassDurationCounter.getStddev().toFixed(3)} ms`;
+ });
+ requestAnimationFrame(frame);
+}
+requestAnimationFrame(frame);
+//# sourceMappingURL=main.js.map
diff --git a/sample/timestampQuery/main.js.map b/sample/timestampQuery/main.js.map
new file mode 100644
index 00000000..fc5a5cba
--- /dev/null
+++ b/sample/timestampQuery/main.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"main.js","sources":["../../../node_modules/wgpu-matrix/dist/3.x/wgpu-matrix.module.js","../../../../../meshes/cube.ts","../../../../../sample/util.ts","../../../../../sample/timestampQuery/PerfCounter.ts","../../../../../sample/timestampQuery/TimestampQueryManager.ts","../../../../../sample/timestampQuery/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","export const cubeVertexSize = 4 * 10; // Byte size of one cube vertex.\nexport const cubePositionOffset = 0;\nexport const cubeColorOffset = 4 * 4; // Byte offset of cube vertex color attribute.\nexport const cubeUVOffset = 4 * 8;\nexport const cubeVertexCount = 36;\n\n// prettier-ignore\nexport const cubeVertexArray = new Float32Array([\n // float4 position, float4 color, float2 uv,\n 1, -1, 1, 1, 1, 0, 1, 1, 0, 1,\n -1, -1, 1, 1, 0, 0, 1, 1, 1, 1,\n -1, -1, -1, 1, 0, 0, 0, 1, 1, 0,\n 1, -1, -1, 1, 1, 0, 0, 1, 0, 0,\n 1, -1, 1, 1, 1, 0, 1, 1, 0, 1,\n -1, -1, -1, 1, 0, 0, 0, 1, 1, 0,\n\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,\n 1, -1, 1, 1, 1, 0, 1, 1, 1, 1,\n 1, -1, -1, 1, 1, 0, 0, 1, 1, 0,\n 1, 1, -1, 1, 1, 1, 0, 1, 0, 0,\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,\n 1, -1, -1, 1, 1, 0, 0, 1, 1, 0,\n\n -1, 1, 1, 1, 0, 1, 1, 1, 0, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, -1, 1, 1, 1, 0, 1, 1, 0,\n -1, 1, -1, 1, 0, 1, 0, 1, 0, 0,\n -1, 1, 1, 1, 0, 1, 1, 1, 0, 1,\n 1, 1, -1, 1, 1, 1, 0, 1, 1, 0,\n\n -1, -1, 1, 1, 0, 0, 1, 1, 0, 1,\n -1, 1, 1, 1, 0, 1, 1, 1, 1, 1,\n -1, 1, -1, 1, 0, 1, 0, 1, 1, 0,\n -1, -1, -1, 1, 0, 0, 0, 1, 0, 0,\n -1, -1, 1, 1, 0, 0, 1, 1, 0, 1,\n -1, 1, -1, 1, 0, 1, 0, 1, 1, 0,\n\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,\n -1, 1, 1, 1, 0, 1, 1, 1, 1, 1,\n -1, -1, 1, 1, 0, 0, 1, 1, 1, 0,\n -1, -1, 1, 1, 0, 0, 1, 1, 1, 0,\n 1, -1, 1, 1, 1, 0, 1, 1, 0, 0,\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,\n\n 1, -1, -1, 1, 1, 0, 0, 1, 0, 1,\n -1, -1, -1, 1, 0, 0, 0, 1, 1, 1,\n -1, 1, -1, 1, 0, 1, 0, 1, 1, 0,\n 1, 1, -1, 1, 1, 1, 0, 1, 0, 0,\n 1, -1, -1, 1, 1, 0, 0, 1, 0, 1,\n -1, 1, -1, 1, 0, 1, 0, 1, 1, 0,\n]);\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","// A minimalistic perf timer class that computes mean + stddev online\nexport default class PerfCounter {\n sampleCount: number;\n accumulated: number;\n accumulatedSq: number;\n\n constructor() {\n this.sampleCount = 0;\n this.accumulated = 0;\n this.accumulatedSq = 0;\n }\n\n addSample(value: number) {\n this.sampleCount += 1;\n this.accumulated += value;\n this.accumulatedSq += value * value;\n }\n\n getAverage(): number {\n return this.sampleCount === 0 ? 0 : this.accumulated / this.sampleCount;\n }\n\n getStddev(): number {\n if (this.sampleCount === 0) return 0;\n const avg = this.getAverage();\n const variance = this.accumulatedSq / this.sampleCount - avg * avg;\n return Math.sqrt(Math.max(0.0, variance));\n }\n}\n","// Regroups all timestamp-related operations and resources.\nexport default class TimestampQueryManager {\n // The device may not support timestamp queries, on which case this whole\n // class does nothing.\n timestampSupported: boolean;\n\n // Number of timestamp counters\n timestampCount: number;\n\n // The query objects. This is meant to be used in a ComputePassDescriptor's\n // or RenderPassDescriptor's 'timestampWrites' field.\n timestampQuerySet: GPUQuerySet;\n\n // A buffer where to store query results\n timestampBuffer: GPUBuffer;\n\n // A buffer to map this result back to CPU\n timestampMapBuffer: GPUBuffer;\n\n // State used to avoid firing concurrent readback of timestamp values\n hasOngoingTimestampReadback: boolean;\n\n // Device must have the \"timestamp-query\" feature\n constructor(device: GPUDevice, timestampCount: number) {\n this.timestampSupported = device.features.has('timestamp-query');\n if (!this.timestampSupported) return;\n\n this.timestampCount = timestampCount;\n\n // Create timestamp queries\n this.timestampQuerySet = device.createQuerySet({\n type: 'timestamp',\n count: timestampCount, // begin and end\n });\n\n // Create a buffer where to store the result of GPU queries\n const timestampByteSize = 8; // timestamps are uint64\n const timestampBufferSize = timestampCount * timestampByteSize;\n this.timestampBuffer = device.createBuffer({\n size: timestampBufferSize,\n usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.QUERY_RESOLVE,\n });\n\n // Create a buffer to map the result back to the CPU\n this.timestampMapBuffer = device.createBuffer({\n size: timestampBufferSize,\n usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,\n });\n\n this.hasOngoingTimestampReadback = false;\n }\n\n // Resolve all timestamp queries and copy the result into the map buffer\n resolveAll(commandEncoder: GPUCommandEncoder) {\n if (!this.timestampSupported) return;\n\n // After the end of the measured render pass, we resolve queries into a\n // dedicated buffer.\n commandEncoder.resolveQuerySet(\n this.timestampQuerySet,\n 0 /* firstQuery */,\n this.timestampCount /* queryCount */,\n this.timestampBuffer,\n 0 /* destinationOffset */\n );\n\n if (!this.hasOngoingTimestampReadback) {\n // Copy values to the mapped buffer\n commandEncoder.copyBufferToBuffer(\n this.timestampBuffer,\n 0,\n this.timestampMapBuffer,\n 0,\n this.timestampBuffer.size\n );\n }\n }\n\n // Once resolved, we can read back the value of timestamps\n readAsync(onTimestampReadBack: (timestamps: BigUint64Array) => void): void {\n if (!this.timestampSupported) return;\n if (this.hasOngoingTimestampReadback) return;\n\n this.hasOngoingTimestampReadback = true;\n\n const buffer = this.timestampMapBuffer;\n void buffer.mapAsync(GPUMapMode.READ).then(() => {\n const rawData = buffer.getMappedRange();\n const timestamps = new BigUint64Array(rawData);\n\n onTimestampReadBack(timestamps);\n\n buffer.unmap();\n this.hasOngoingTimestampReadback = false;\n });\n }\n}\n","import { mat4, vec3 } from 'wgpu-matrix';\n\nimport {\n cubeVertexArray,\n cubeVertexSize,\n cubeUVOffset,\n cubePositionOffset,\n cubeVertexCount,\n} from '../../meshes/cube';\n\nimport basicVertWGSL from '../../shaders/basic.vert.wgsl';\nimport fragmentWGSL from '../../shaders/black.frag.wgsl';\nimport { quitIfWebGPUNotAvailable } from '../util';\n\nimport PerfCounter from './PerfCounter';\nimport TimestampQueryManager from './TimestampQueryManager';\n\nconst canvas = document.querySelector('canvas') as HTMLCanvasElement;\nconst adapter = await navigator.gpu?.requestAdapter();\n\n// The use of timestamps require a dedicated adapter feature:\n// The adapter may or may not support timestamp queries. If not, we simply\n// don't measure timestamps and deactivate the timer display.\nconst supportsTimestampQueries = adapter?.features.has('timestamp-query');\n\nconst device = await adapter?.requestDevice({\n // We request a device that has support for timestamp queries\n requiredFeatures: supportsTimestampQueries ? ['timestamp-query'] : [],\n});\nquitIfWebGPUNotAvailable(adapter, device);\n\n// GPU-side timer and the CPU-side counter where we accumulate statistics:\n// NB: Look for 'timestampQueryManager' in this file to locate parts of this\n// snippets that are related to timestamps. Most of the logic is in\n// TimestampQueryManager.ts.\nconst timestampQueryManager = new TimestampQueryManager(device, 2);\nconst renderPassDurationCounter = new PerfCounter();\n\nconst context = canvas.getContext('webgpu') as GPUCanvasContext;\n\nconst devicePixelRatio = window.devicePixelRatio;\ncanvas.width = canvas.clientWidth * devicePixelRatio;\ncanvas.height = canvas.clientHeight * devicePixelRatio;\nconst presentationFormat = navigator.gpu.getPreferredCanvasFormat();\n\ncontext.configure({\n device,\n format: presentationFormat,\n});\n\n// UI for perf counter\nconst perfDisplayContainer = document.createElement('div');\nperfDisplayContainer.style.color = 'white';\nperfDisplayContainer.style.background = 'black';\nperfDisplayContainer.style.position = 'absolute';\nperfDisplayContainer.style.top = '10px';\nperfDisplayContainer.style.left = '10px';\n\nconst perfDisplay = document.createElement('pre');\nperfDisplayContainer.appendChild(perfDisplay);\nif (canvas.parentNode) {\n canvas.parentNode.appendChild(perfDisplayContainer);\n} else {\n console.error('canvas.parentNode is null');\n}\n\nif (!supportsTimestampQueries) {\n perfDisplay.innerHTML = 'Timestamp queries are not supported';\n}\n\n// Create a vertex buffer from the cube data.\nconst verticesBuffer = device.createBuffer({\n size: cubeVertexArray.byteLength,\n usage: GPUBufferUsage.VERTEX,\n mappedAtCreation: true,\n});\nnew Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray);\nverticesBuffer.unmap();\n\nconst pipeline = device.createRenderPipeline({\n layout: 'auto',\n vertex: {\n module: device.createShaderModule({\n code: basicVertWGSL,\n }),\n buffers: [\n {\n arrayStride: cubeVertexSize,\n attributes: [\n {\n // position\n shaderLocation: 0,\n offset: cubePositionOffset,\n format: 'float32x4',\n },\n {\n // uv\n shaderLocation: 1,\n offset: cubeUVOffset,\n format: 'float32x2',\n },\n ],\n },\n ],\n },\n fragment: {\n module: device.createShaderModule({\n code: fragmentWGSL,\n }),\n targets: [\n {\n format: presentationFormat,\n },\n ],\n },\n primitive: {\n topology: 'triangle-list',\n\n // Backface culling since the cube is solid piece of geometry.\n // Faces pointing away from the camera will be occluded by faces\n // pointing toward the camera.\n cullMode: 'back',\n },\n\n // Enable depth testing so that the fragment closest to the camera\n // is rendered in front.\n depthStencil: {\n depthWriteEnabled: true,\n depthCompare: 'less',\n format: 'depth24plus',\n },\n});\n\nconst depthTexture = device.createTexture({\n size: [canvas.width, canvas.height],\n format: 'depth24plus',\n usage: GPUTextureUsage.RENDER_ATTACHMENT,\n});\n\nconst uniformBufferSize = 4 * 16; // 4x4 matrix\nconst uniformBuffer = device.createBuffer({\n size: uniformBufferSize,\n usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,\n});\n\nconst uniformBindGroup = device.createBindGroup({\n layout: pipeline.getBindGroupLayout(0),\n entries: [\n {\n binding: 0,\n resource: {\n buffer: uniformBuffer,\n },\n },\n ],\n});\n\nconst renderPassDescriptor: GPURenderPassDescriptor = {\n colorAttachments: [\n {\n view: undefined, // Assigned later\n\n clearValue: [0.95, 0.95, 0.95, 1.0],\n loadOp: 'clear',\n storeOp: 'store',\n },\n ],\n depthStencilAttachment: {\n view: depthTexture.createView(),\n\n depthClearValue: 1.0,\n depthLoadOp: 'clear',\n depthStoreOp: 'store',\n },\n // We instruct the render pass to write to the timestamp query before/after\n timestampWrites: {\n querySet: timestampQueryManager.timestampQuerySet,\n beginningOfPassWriteIndex: 0,\n endOfPassWriteIndex: 1,\n },\n};\n\nconst aspect = canvas.width / canvas.height;\nconst projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0);\nconst modelViewProjectionMatrix = mat4.create();\n\nfunction getTransformationMatrix() {\n const viewMatrix = mat4.identity();\n mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix);\n const now = Date.now() / 1000;\n mat4.rotate(\n viewMatrix,\n vec3.fromValues(Math.sin(now), Math.cos(now), 0),\n 1,\n viewMatrix\n );\n\n mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix);\n\n return modelViewProjectionMatrix;\n}\n\nfunction frame() {\n const transformationMatrix = getTransformationMatrix();\n device.queue.writeBuffer(\n uniformBuffer,\n 0,\n transformationMatrix.buffer,\n transformationMatrix.byteOffset,\n transformationMatrix.byteLength\n );\n renderPassDescriptor.colorAttachments[0].view = context\n .getCurrentTexture()\n .createView();\n\n const commandEncoder = device.createCommandEncoder();\n const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);\n passEncoder.setPipeline(pipeline);\n passEncoder.setBindGroup(0, uniformBindGroup);\n passEncoder.setVertexBuffer(0, verticesBuffer);\n passEncoder.draw(cubeVertexCount);\n passEncoder.end();\n\n // Resolve timestamp queries, so that their result is available in\n // a GPU-sude buffer.\n timestampQueryManager.resolveAll(commandEncoder);\n\n device.queue.submit([commandEncoder.finish()]);\n\n // Read timestamp value back from GPU buffers\n timestampQueryManager.readAsync((timestamps) => {\n // This may happen (see spec https://gpuweb.github.io/gpuweb/#timestamp)\n if (timestamps[1] < timestamps[0]) return;\n\n // Measure difference (in bigints)\n const elapsedNs = timestamps[1] - timestamps[0];\n // Cast into regular int (ok because value is small after difference)\n // and convert from nanoseconds to milliseconds:\n const elapsedMs = Number(elapsedNs) * 1e-6;\n renderPassDurationCounter.addSample(elapsedMs);\n console.log(\n 'timestamps (ms): elapsed',\n elapsedMs,\n 'avg',\n renderPassDurationCounter.getAverage()\n );\n perfDisplay.innerHTML = `Render Pass duration: ${renderPassDurationCounter\n .getAverage()\n .toFixed(3)} ms ± ${renderPassDurationCounter.getStddev().toFixed(3)} ms`;\n });\n\n requestAnimationFrame(frame);\n}\nrequestAnimationFrame(frame);\n"],"names":[],"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,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C,CAAC;IAEF,qBAAqB,CAAC,KAAK,CAAC;AAC9B;AACA,qBAAqB,CAAC,KAAK,CAAC","x_google_ignoreList":[0]}
\ No newline at end of file
diff --git a/sample/timestampQuery/main.ts b/sample/timestampQuery/main.ts
new file mode 100644
index 00000000..66f11ad0
--- /dev/null
+++ b/sample/timestampQuery/main.ts
@@ -0,0 +1,254 @@
+import { mat4, vec3 } from 'wgpu-matrix';
+
+import {
+ cubeVertexArray,
+ cubeVertexSize,
+ cubeUVOffset,
+ cubePositionOffset,
+ cubeVertexCount,
+} from '../../meshes/cube';
+
+import basicVertWGSL from '../../shaders/basic.vert.wgsl';
+import fragmentWGSL from '../../shaders/black.frag.wgsl';
+import { quitIfWebGPUNotAvailable } from '../util';
+
+import PerfCounter from './PerfCounter';
+import TimestampQueryManager from './TimestampQueryManager';
+
+const canvas = document.querySelector('canvas') as HTMLCanvasElement;
+const adapter = await navigator.gpu?.requestAdapter();
+
+// The use of timestamps require a dedicated adapter feature:
+// The adapter may or may not support timestamp queries. If not, we simply
+// don't measure timestamps and deactivate the timer display.
+const supportsTimestampQueries = adapter?.features.has('timestamp-query');
+
+const device = await adapter?.requestDevice({
+ // We request a device that has support for timestamp queries
+ requiredFeatures: supportsTimestampQueries ? ['timestamp-query'] : [],
+});
+quitIfWebGPUNotAvailable(adapter, device);
+
+// GPU-side timer and the CPU-side counter where we accumulate statistics:
+// NB: Look for 'timestampQueryManager' in this file to locate parts of this
+// snippets that are related to timestamps. Most of the logic is in
+// TimestampQueryManager.ts.
+const timestampQueryManager = new TimestampQueryManager(device, 2);
+const renderPassDurationCounter = new PerfCounter();
+
+const context = canvas.getContext('webgpu') as GPUCanvasContext;
+
+const devicePixelRatio = window.devicePixelRatio;
+canvas.width = canvas.clientWidth * devicePixelRatio;
+canvas.height = canvas.clientHeight * devicePixelRatio;
+const presentationFormat = navigator.gpu.getPreferredCanvasFormat();
+
+context.configure({
+ device,
+ format: presentationFormat,
+});
+
+// UI for perf counter
+const perfDisplayContainer = document.createElement('div');
+perfDisplayContainer.style.color = 'white';
+perfDisplayContainer.style.background = 'black';
+perfDisplayContainer.style.position = 'absolute';
+perfDisplayContainer.style.top = '10px';
+perfDisplayContainer.style.left = '10px';
+
+const perfDisplay = document.createElement('pre');
+perfDisplayContainer.appendChild(perfDisplay);
+if (canvas.parentNode) {
+ canvas.parentNode.appendChild(perfDisplayContainer);
+} else {
+ console.error('canvas.parentNode is null');
+}
+
+if (!supportsTimestampQueries) {
+ perfDisplay.innerHTML = 'Timestamp queries are not supported';
+}
+
+// Create a vertex buffer from the cube data.
+const verticesBuffer = device.createBuffer({
+ size: cubeVertexArray.byteLength,
+ usage: GPUBufferUsage.VERTEX,
+ mappedAtCreation: true,
+});
+new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray);
+verticesBuffer.unmap();
+
+const pipeline = device.createRenderPipeline({
+ layout: 'auto',
+ vertex: {
+ module: device.createShaderModule({
+ code: basicVertWGSL,
+ }),
+ buffers: [
+ {
+ arrayStride: cubeVertexSize,
+ attributes: [
+ {
+ // position
+ shaderLocation: 0,
+ offset: cubePositionOffset,
+ format: 'float32x4',
+ },
+ {
+ // uv
+ shaderLocation: 1,
+ offset: cubeUVOffset,
+ format: 'float32x2',
+ },
+ ],
+ },
+ ],
+ },
+ fragment: {
+ module: device.createShaderModule({
+ code: fragmentWGSL,
+ }),
+ targets: [
+ {
+ format: presentationFormat,
+ },
+ ],
+ },
+ primitive: {
+ topology: 'triangle-list',
+
+ // Backface culling since the cube is solid piece of geometry.
+ // Faces pointing away from the camera will be occluded by faces
+ // pointing toward the camera.
+ cullMode: 'back',
+ },
+
+ // Enable depth testing so that the fragment closest to the camera
+ // is rendered in front.
+ depthStencil: {
+ depthWriteEnabled: true,
+ depthCompare: 'less',
+ format: 'depth24plus',
+ },
+});
+
+const depthTexture = device.createTexture({
+ size: [canvas.width, canvas.height],
+ format: 'depth24plus',
+ usage: GPUTextureUsage.RENDER_ATTACHMENT,
+});
+
+const uniformBufferSize = 4 * 16; // 4x4 matrix
+const uniformBuffer = device.createBuffer({
+ size: uniformBufferSize,
+ usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
+});
+
+const uniformBindGroup = device.createBindGroup({
+ layout: pipeline.getBindGroupLayout(0),
+ entries: [
+ {
+ binding: 0,
+ resource: {
+ buffer: uniformBuffer,
+ },
+ },
+ ],
+});
+
+const renderPassDescriptor: GPURenderPassDescriptor = {
+ colorAttachments: [
+ {
+ view: undefined, // Assigned later
+
+ clearValue: [0.95, 0.95, 0.95, 1.0],
+ loadOp: 'clear',
+ storeOp: 'store',
+ },
+ ],
+ depthStencilAttachment: {
+ view: depthTexture.createView(),
+
+ depthClearValue: 1.0,
+ depthLoadOp: 'clear',
+ depthStoreOp: 'store',
+ },
+ // We instruct the render pass to write to the timestamp query before/after
+ timestampWrites: {
+ querySet: timestampQueryManager.timestampQuerySet,
+ beginningOfPassWriteIndex: 0,
+ endOfPassWriteIndex: 1,
+ },
+};
+
+const aspect = canvas.width / canvas.height;
+const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0);
+const modelViewProjectionMatrix = mat4.create();
+
+function getTransformationMatrix() {
+ const viewMatrix = mat4.identity();
+ mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix);
+ const now = Date.now() / 1000;
+ mat4.rotate(
+ viewMatrix,
+ vec3.fromValues(Math.sin(now), Math.cos(now), 0),
+ 1,
+ viewMatrix
+ );
+
+ mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix);
+
+ return modelViewProjectionMatrix;
+}
+
+function frame() {
+ const transformationMatrix = getTransformationMatrix();
+ device.queue.writeBuffer(
+ uniformBuffer,
+ 0,
+ transformationMatrix.buffer,
+ transformationMatrix.byteOffset,
+ transformationMatrix.byteLength
+ );
+ renderPassDescriptor.colorAttachments[0].view = context
+ .getCurrentTexture()
+ .createView();
+
+ const commandEncoder = device.createCommandEncoder();
+ const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
+ passEncoder.setPipeline(pipeline);
+ passEncoder.setBindGroup(0, uniformBindGroup);
+ passEncoder.setVertexBuffer(0, verticesBuffer);
+ passEncoder.draw(cubeVertexCount);
+ passEncoder.end();
+
+ // Resolve timestamp queries, so that their result is available in
+ // a GPU-sude buffer.
+ timestampQueryManager.resolveAll(commandEncoder);
+
+ device.queue.submit([commandEncoder.finish()]);
+
+ // Read timestamp value back from GPU buffers
+ timestampQueryManager.readAsync((timestamps) => {
+ // This may happen (see spec https://gpuweb.github.io/gpuweb/#timestamp)
+ if (timestamps[1] < timestamps[0]) return;
+
+ // Measure difference (in bigints)
+ const elapsedNs = timestamps[1] - timestamps[0];
+ // Cast into regular int (ok because value is small after difference)
+ // and convert from nanoseconds to milliseconds:
+ const elapsedMs = Number(elapsedNs) * 1e-6;
+ renderPassDurationCounter.addSample(elapsedMs);
+ console.log(
+ 'timestamps (ms): elapsed',
+ elapsedMs,
+ 'avg',
+ renderPassDurationCounter.getAverage()
+ );
+ perfDisplay.innerHTML = `Render Pass duration: ${renderPassDurationCounter
+ .getAverage()
+ .toFixed(3)} ms ± ${renderPassDurationCounter.getStddev().toFixed(3)} ms`;
+ });
+
+ requestAnimationFrame(frame);
+}
+requestAnimationFrame(frame);
diff --git a/sample/timestampQuery/meta.ts b/sample/timestampQuery/meta.ts
new file mode 100644
index 00000000..5fae2dc3
--- /dev/null
+++ b/sample/timestampQuery/meta.ts
@@ -0,0 +1,14 @@
+export default {
+ name: 'Timestamp Query',
+ description:
+ 'This example shows how to use timestamp queries to measure render pass duration.',
+ filename: __DIRNAME__,
+ sources: [
+ { path: 'TimestampQueryManager.ts' },
+ { path: 'PerfCounter.ts' },
+ { path: 'main.ts' },
+ { path: '../../shaders/basic.vert.wgsl' },
+ { path: '../../shaders/black.frag.wgsl' },
+ { path: '../../meshes/cube.ts' },
+ ],
+};
diff --git a/samples/timestampQuery/index.html b/samples/timestampQuery/index.html
new file mode 100644
index 00000000..0c81b3bf
--- /dev/null
+++ b/samples/timestampQuery/index.html
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/shaders/black.frag.wgsl b/shaders/black.frag.wgsl
new file mode 100644
index 00000000..cb832ded
--- /dev/null
+++ b/shaders/black.frag.wgsl
@@ -0,0 +1,4 @@
+@fragment
+fn main() -> @location(0) vec4f {
+ return vec4(0.0, 0.0, 0.0, 1.0);
+}
\ No newline at end of file